http://blog.csdn.net/lilu_leo/article/details/11952717 有时候需要在在代码中设置LayoutParams,自己为一个FrameLayout设置LayoutParams的时候,遇上如题问题,java.lang.ClassCastExceptio.....
分类:
移动开发 时间:
2014-12-17 17:47:45
阅读次数:
154
//创建线性linearlayout布局对象LinearLayoutll=newLinearLayout(this);//设置linearlayout布局方向ll.setOrientation(LinearLayout.VERTICAL);//得到布局或控件高度intheight=LinearLayout.LayoutParams.MATCH_PARENT;//得到布局或控件宽度intwidth=LinearLayout.LayoutParams..
分类:
移动开发 时间:
2014-12-16 19:30:22
阅读次数:
156
背景:在做一个进度条时,不想让它的背景变暗,以免影响其他区域的正常显示。在网上搜索时,看到的方法多数是:方法一 :在代码中 可以这么设置 Window mWindow = getWindow(); WindowManager.LayoutParams lp = mWindow.getAttribut...
分类:
其他好文 时间:
2014-12-11 15:23:51
阅读次数:
177
1 LinearLayout.LayoutParams linearParams2 = (LinearLayout.LayoutParams)liveGrid.getLayoutParams();2 linearParams2.width=(shipin_Adapter.getCou...
分类:
移动开发 时间:
2014-12-08 13:50:40
阅读次数:
213
//Activity里面编辑布局//LinearLayoutlayout=newLinearLayout(this);//LayoutParamsparam=newLayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);//layout.setOrientation(layout.VERTICAL);//TextViewtv=newTextView(this);//tv.setTex..
分类:
其他好文 时间:
2014-12-02 09:06:13
阅读次数:
181
WindowManager.LayoutParams wlp = new WindowManager.LayoutParams(width, height, WindowManager.LayoutParams.TYPE_SYSTEM_ERROR, ...
1 dialog 对话框出现和消失 使用的方法
final Dialog dialog = new Dialog(this);
dialog.show();
Window window = dialog.getWindow();
WindowManager.LayoutParams lp = window.getAttributes();
window.s...
分类:
移动开发 时间:
2014-11-24 17:16:59
阅读次数:
235
Gallery.java
//在onCreat方法中setContentView()之前插入
getWindow().setFlags(WindowManager.LayoutParams. FLAG_FULLSCREEN ,
WindowManager.LayoutParams. FLAG_FULLSCREEN);//全屏...
分类:
移动开发 时间:
2014-11-24 10:05:24
阅读次数:
150
1、在Android4.0之前的版本,可以在Activity中的onAttachedToWindow添加如下代码实现:@OverridepublicvoidonAttachedToWindow(){getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);super.onAttachedToWindow();}2、4.0以后的版本,处理方法如下:先自己..
分类:
移动开发 时间:
2014-11-22 19:02:34
阅读次数:
173
定义:1 private RelativeLayout mrlay;调高度:1 mrlay = (RelativeLayout) findViewById(R.id.rlay_1);2 android.view.ViewGroup.LayoutParams pp =mrlay.get...
分类:
移动开发 时间:
2014-11-22 18:41:18
阅读次数:
228