开发者

Android: How to programmatically set dialog size?

开发者 https://www.devze.com 2022-12-14 12:22 出处:网络
I want do set size (in px) of dialog based on screen resolution, so I have to set dialog size programmatically 开发者_如何学JAVAduring runtime.

I want do set size (in px) of dialog based on screen resolution, so I have to set dialog size programmatically 开发者_如何学JAVAduring runtime.

Dialog layout is defined in xml with all standard views, so it would be nice to have better way to set dialog size than override-in top view's onMeasure(...).

(Android 1.5 SDK)


I would suggest reading Google's Dev Guide on supporting multiple screen sizes.

http://developer.android.com/guide/practices/screens_support.html

Using pixels for view sizes is a bad idea.

0

精彩评论

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