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

屏幕适配方案 #15

Open
liuyuttkx opened this issue Mar 16, 2018 · 0 comments
Open

屏幕适配方案 #15

liuyuttkx opened this issue Mar 16, 2018 · 0 comments

Comments

@liuyuttkx
Copy link

liuyuttkx commented Mar 16, 2018

需求: 在屏幕上只想显示五个item.
解决方案: 根据自身item的宽和设置item间隔因数,来调整显示在屏幕上面的个数. 设定好只显示五个item.
但是由于屏幕的像素密度不一致的问题. 会导致部分手机上显示不同, 可能会显示七个或是更多.
例如乐视 Le x260手机 1dp = 2.625px. 它比其它手机可能会多显示两个或是更多.

推荐使用张鸿洋的AndroidAutoLayout库.
https://github.com/hongyangAndroid/AndroidAutoLayout
对它的item进行尺寸适配, 所有屏幕基上就长的一样了, 这样下来就可以完美解决了

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

No branches or pull requests

1 participant