
先用一个TextView获得你的
基准控件的id,这样这个TextView就是那个基准控件了,然后新建一个TextView在后面找库函数,设置在基准控件的右边就行了,最后别忘了加上contentView函数private LinearLayout.LayoutParams LP_FF = new LinearLayout.LayoutParams (LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)ScrollView sv = new ScrollView(this)sv.setLayoutParams( LP_FF )LinearLayout layout = new LinearLayout(this)//
线性布局方式 layout.setOrientation( LinearLayout.VERTICAL )//控件对其方式为垂直排列 sv.addView( layout )//把线性布局加入到ScrollView中 setContentView(sv)//设置当前的页面为ScrollView CheckBox tv = new CheckBox(this)tv.setId(10)tv.setText( "fsdfsdfsdfsd" )layout.addView( tv )
评论列表(0条)