开发者

Android: How to programmatically set dialog size?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜