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.
精彩评论