动态改变控件大小
2016-09-01 10:32
267 查看
区分父布局
rootLayout = (LinearLayout) findViewById(R.id.test_root_linearlayout);
LinearLayout.LayoutParams rootLinaerParams = new LinearLayout.LayoutParams(
100, 100);
ViewGroup.LayoutParams rootGroupParams = new LinearLayout.LayoutParams(
100, 100);
RelativeLayout.LayoutParams rootRelativeParams = new RelativeLayout.LayoutParams(
100, 100);
TextView testView = new TextView(this);
testView.setText("根布局测试动态添加组件并设置其大小");
testView.setLayoutParams(rootGroupParams);
rootLayout.addView(testView);
rootLayout = (LinearLayout) findViewById(R.id.test_root_linearlayout);
LinearLayout.LayoutParams rootLinaerParams = new LinearLayout.LayoutParams(
100, 100);
ViewGroup.LayoutParams rootGroupParams = new LinearLayout.LayoutParams(
100, 100);
RelativeLayout.LayoutParams rootRelativeParams = new RelativeLayout.LayoutParams(
100, 100);
TextView testView = new TextView(this);
testView.setText("根布局测试动态添加组件并设置其大小");
testView.setLayoutParams(rootGroupParams);
rootLayout.addView(testView);
相关文章推荐
- c# 动态改变控件大小的方法
- cedit cstatic控件动态生成及字体大小改变
- Android 动态改变控件大小
- Android动态改变控件大小
- MFC改变对话框的大小,以及子控件的动态改变
- 动态改变对话框中控件的大小
- [搬家帖]动态改变对话框中控件的大小
- Visual C++中动态改变控件和对话框字体(大小) (转载)
- MFC改变对话框的大小,以及子控件的动态改变
- Visual C++中动态改变控件和对话框字体(大小) (转载)
- c# 动态改变控件大小的方法
- 动态改变控件大小
- VC中动态改变控件和对话框字体(大小)
- vb.net中运行时动态改变控件大小
- 关于动态改变控件大小的一点不同的看法(转)
- 动态改变控件大小
- android 动态改变控件位置和大小
- 动态改变Android控件大小 (转)
- 动态改变Android控件大小
- 动态改变Android控件大小