设置Theme为Theme.Dialog形式的Activity的宽和高
2015-11-10 15:19
381 查看
mDisplay = getWindowManager().getDefaultDisplay(); DisplayMetrics outMetrics = new DisplayMetrics(); mDisplay.getMetrics(outMetrics); LayoutParams layoutParams = getWindow().getAttributes(); layoutParams.width = (int) (outMetrics.widthPixels * 0.7); layoutParams.height = (int) (outMetrics.heightPixels * 0.8); getWindow().setAttributes(layoutParams);
相关文章推荐
- 字符串循环右移
- ubuntu14.04 amd64编译vlc
- 运用java语言求1到1000内所有的完数(带源程序)
- org.springframework.web.servlet.mvc.support.RedirectAttributes
- 简单几何(半平面交+二分) LA 3890 Most Distant Point from the Sea
- VS2013编译libcurl
- 关于UIScrollview不能响应touch事件的解决办法
- Tomcat优化详解
- Installation error code: -103签名不一致错误
- Android Fragment 入门介绍
- 98-基于FPGA Spartan6 的双路光纤PCIe采集卡(2路光纤卡)
- PhoneGap 3 在 Mac 上安装使用
- Android Drawable
- python列表和元组
- grep
- 【原创】MySQL5.7 JSON类型使用介绍
- 【原创】MySQL5.7 JSON类型使用介绍
- monitor工作方式
- Android SpinnerAdapter 的使用
- thinkphp中常用方法