简体   繁体   中英

Android set image view height according to width

How can I set ImageView's height to keep it's aspect ratio? In XML I set fill_parent as layout width and wrap_content as layout height, but I got this: Screenshot http://kepfeltoltes.hu/141206/Screenshot_2014-12-06-19-09-30_1__www.kepfeltoltes.hu_.png

您可以在ImageView中的代码中使用android:adjustViewBounds="true"setAdjustViewBounds(true)

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