Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修正某些机型设置ScaleType.FIT_CENTER时不生效的问题 #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Drizzlezhang
Copy link

No description provided.

Copy link
Owner

@bm-x bm-x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

额,这个我记得似乎fitCenter是不对高度的进行判断的额? 直接用ImageView是怎样的额?

@Drizzlezhang
Copy link
Author

Drizzlezhang commented Nov 9, 2016

抱歉你的源码我也没有通读。主要是用这个控件的时候某些机型上竖图FIT_CENTER无效(横图正常),还是CENTER_CROP,我就看了下这部分代码,然后感觉这部分只是依据宽度处理是不是不太对,应该宽高都做判断?然后仿照你之前的代码处理了一下就没有问题了

@bm-x
Copy link
Owner

bm-x commented Nov 17, 2016

你可以参考ImaActivity中的布局activity_img.xml.
将src设置为ccc, 宽度设置为150dp,高度设置,从100dp开始,一百一百的加,加到600dp,我看了下应该是没啥问题的

@Drizzlezhang
Copy link
Author

我知道,正常情况下没问题,也是在某些机型上有问题,现在我们项目用的是这么改动后的代码是没问题的。如果这个代码你觉得不行的话我提个issue吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants