"turn" Android fill_parent and Wrap_content analysis
Source: Internet
Author: User
<span id="Label3"></p><p><p>Fill_parent set a top layout or control to make it full of screens.</p></p><p><p>Wrap_content layouts are automatically scaled according to the contents of the view to fit their size.</p></p><p><p></p></p>1. wrap_content<p><p><?xml version= "1.0" encoding= "utf-8"?><br><relativelayout xmlns:android= "http://schemas.android.com/apk/res/android"<br>Android:layout_width= "fill_parent"<br>android:layout_height= "fill_parent" ><br><br><button<br>Android:id= "@+id/btnbutton1"<br>Android:layout_width= "wrap_content"<br>android:layout_height= "wrap_content"<br>android:text= "button CJP"/><br><br></RelativeLayout></p></p><p><p></p></p><p><p></p></p><p><p></p></p>2. fill_parent–width<p><p><?xml version= "1.0" encoding= "utf-8"?><br><relativelayout xmlns:android= "http://schemas.android.com/apk/res/android"<br>Android:layout_width= "fill_parent"<br>android:layout_height= "fill_parent" ><br><br><button<br>Android:id= "@+id/btnbutton1"<br>Android:layout_width= "fill_parent"<br>android:layout_height= "wrap_content"<br>android:text= "button CJP"/><br><br></RelativeLayout></p></p><p><p></p></p><p><p></p></p><p><p></p></p>3. Fill_parent–height<p><p><?xml version= "1.0" encoding= "utf-8"?><br><relativelayout xmlns:android= "http://schemas.android.com/apk/res/android"<br>Android:layout_width= "fill_parent"<br>android:layout_height= "fill_parent" ><br><br><button<br>Android:id= "@+id/btnbutton1"<br>Android:layout_width= "wrap_content"<br>android:layout_height= "fill_parent"<br>android:text= "button CJP"/><br><br></RelativeLayout></p></p><p><p></p></p><p><p></p></p><p><p></p></p>4. fill_parent–width, Height<p><p><?xml version= "1.0" encoding= "utf-8"?><br><relativelayout xmlns:android= "http://schemas.android.com/apk/res/android"<br>Android:layout_width= "fill_parent"<br>android:layout_height= "fill_parent" ><br><br><button<br>Android:id= "@+id/btnbutton1"<br>Android:layout_width= "fill_parent"<br>android:layout_height= "fill_parent"<br>android:text= "button CJP"/><br><br></RelativeLayout></p></p><p><p></p></p><p><p></p></p><p><p></p></p><p><p>from:http://blog.csdn.net/jumping_android/article/details/7397991</p></p><p><p>"turn" Android fill_parent and Wrap_content analysis</p></p></span>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service