标签:android style http color io ar java sp on
============问题描述============
DownLoaderDialog dialog=new DownLoaderDialog(MainActivity.this,R.style.dialog); Window mwindow=dialog.getWindow(); WindowManager.LayoutParams lp=mwindow.getAttributes(); int[] location = new int[2]; button.getLocationOnScreen(location); WindowManager m = getWindowManager(); Display d = m.getDefaultDisplay(); lp.y=location[1]; lp.height = (int) (d.getHeight() * 0.6); mwindow.setAttributes(lp); dialog.show();
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <LinearLayout android:layout_width="match_parent" android:layout_height="0px" android:layout_weight="1" android:background="#ECEFF0" > <ListView android:id="@+id/listView1" android:layout_width="match_parent" android:layout_height="wrap_content" > </ListView> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="50dp" android:background="#0BA683" android:gravity="center_vertical" android:orientation="horizontal" > <Button android:id="@+id/btnDelete" android:layout_width="0px" android:layout_height="match_parent" android:layout_weight="1" android:background="@drawable/btn_pressed_style" android:text="删除" android:textColor="#FDFEFE" android:textSize="16sp" /> <View android:layout_width="1dp" android:layout_height="match_parent" android:background="#DADBDA" /> <Button android:id="@+id/btnSelectAll" android:layout_width="0px" android:layout_height="match_parent" android:layout_weight="1" android:background="@drawable/btn_pressed_style" android:text="全选" android:textColor="#FDFEFE" android:textSize="16sp" /> </LinearLayout> </LinearLayout>
============解决方案1============
============解决方案2============
============解决方案3============
最近开发老遇到莫名其妙的问题,dialog自定义大小,setAttributes这个方法没反应是肿么一回事
标签:android style http color io ar java sp on
原文地址:http://www.cnblogs.com/meizhenfen42/p/4041872.html