简体   繁体   中英

Different screen size layout on Android

I created layouts for each screen. as sw300dp , sw360dp , sw420dp , sw600dp and sw720dp . But there are different screen sizes that support sw-360dp . For example, 1080x1920 and 1080x2280 images change in my changes to sw360 . The image is distorted because the two screen sizes are different.

How can I solve this problem?

模拟器屏幕尺寸 布局源

If you want enforce certain size (which in discouraged, because android devices varies in screen ratios, sizes and densities in large extent, and there always be some device, where image will be distorted) you can add constraint for minimum height, like drawable-sw360dp-h1024dp . Or simply use proper scaleType for imageview.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM