标签:viewstub eth mod height res text inux pos bcd
Inflate() method can find out a layout defined by xml,as like the findViewById() method,but there have some different between them.
The different are:
If your Activity used other layout,such as the dialog layout,and you want to set the component‘s content in that layout.you must use the inflate() method to find it out,then use the findViewById() method to find other components above it.such as:
View view1=View.inflate(this,R.layout.dialog_layout,null); TextViewdialogTV=(TextView)view1.findViewById(R.id.dialog_tv); dialogTV.setText("abcd");
View viewStub = ((ViewStub) findViewById(R.id.stubView)).inflate();
after inflate(),it must have size,but hide.
if you also interest in linux and android embed system,please connection with us in QQ grounp:139761394
The method Inflate() in android
标签:viewstub eth mod height res text inux pos bcd
原文地址:http://www.cnblogs.com/cynchanpin/p/7265368.html