开发者

Imageview.setMaxHeight is working wrong

开发者 https://www.devze.com 2023-02-09 06:37 出处:网络
Hy! I download a picture from the internet and want to display it. The height should be 1/6 of the max screen height (for multi phone support)

Hy!

I download a picture from the internet and want to display it. The height should be 1/6 of the max screen height (for multi phone support)

Code:

final ImageView iv = (ImageView) findViewById(R.id.ImageView01);

iv.setMaxHeight(getWindowManager().开发者_JAVA技巧getDefaultDisplay().getHeight()/6);

Please help!


Try using the layout_weight attribute of LinearLayout to divide the screen into the parts you need. The ratio of the values you set to the different parts makes the parts become bigger or smaller.

0

精彩评论

暂无评论...
验证码 换一张
取 消