Use of Android:weight

Source: Internet
Author: User
<span id="Label3"></p> <table cellspacing="0" cellpadding="0" width="1118" style="width:718px;"> <tbody> <tr> <td class="t_f" id="postmessage_1520" style="font-size:14px;"><p><p><span style="color:#000;"><span style="font-family:Helvetica, Tahoma, Arial, sans-serif;"><span style="font-family:Tahoma, Helvetica, SimSun, sans-serif;">Android</span>: Weight property to display controls at set scale based on phone aspect</span></span></p></p><p><p><span style="color:#000;"><span style="font-family:Helvetica, Tahoma, Arial, sans-serif;">Such as:</span></span></p></p><p><p><span style="color:#000;"><span style="font-family:Helvetica, Tahoma, Arial, sans-serif;">Proportional Display on width</span></span></p></p><p><span style="color:#000;"><span style="font-family:Helvetica, Tahoma, Arial, sans-serif;"><linearlayout<br>android:layout_margintop= "5dp"<br>Android650) this.width=650; "src=" http://techfoxbbs.com/static/image/smiley/default/shocked.gif "border=" 0 "/> rientation= "horizontal"<br> <span style="font-weight:700;"><span style="font-weight:700;">android:layout_width= "fill_parent"----------------to make it full-width</span></span><br>android:layout_height= "wrap_content" ><br><button<br>Android:id= "@+id/first_sex1_4"<br>android:layout_marginleft= "15dp"<br><span style="font-weight:700;"><span style="font-weight:700;">android:layout_width= "0dp"</span></span>---------set the 0DP so that the width is generated proportionally<br><span style="font-weight:700;"><span style="font-weight:700;">android:layout_weight= "1"</span></span><br>android:layout_height= "50dp"/><br><button<br>Android:id= "@+id/first_sex1_5"<br>android:layout_marginleft= "5dp"<br><span style="font-weight:700;"><span style="font-weight:700;">android:layout_width= "0dp"</span></span><br><span style="font-weight:700;"><span style="font-weight:700;">android:layout_weight= "3"</span></span><br>android:layout_height= "50dp"/><br></LinearLayout></span></span></p><p><p><span style="color:#000;"><span style="font-family:Helvetica, Tahoma, Arial, sans-serif;">Note Now <span style="font-weight:700;">android:layout_width= "0dp"</span></span></span></p></p><p><p><span style="color:#000;"><span style="font-family:Helvetica, Tahoma, Arial, sans-serif;">The final 3 buttons display a width ratio of 1:3, as with weight, with high weights and large display widths</span></span></p></p><br><p><p><span style="color:#000;"><span style="font-family:Helvetica, Tahoma, Arial, sans-serif;">But if you put <span style="font-weight:700;">android:layout_width= "fill_parent"</span></span></span></p></p><p><span style="color:#000;"><span style="font-family:Helvetica, Tahoma, Arial, sans-serif;"><linearlayout<br>android:layout_margintop= "5dp"<br>Android650) this.width=650; "src=" http://techfoxbbs.com/static/image/smiley/default/shocked.gif "border=" 0 "/> rientation= "horizontal"<br><span style="font-weight:700;"><span style="font-weight:700;">android:layout_width= "fill_parent"----------------to make it full-width</span></span><br>android:layout_height= "wrap_content" ><br><button<br>Android:id= "@+id/first_sex1_4"<br>android:layout_marginleft= "15dp"<br><span style="font-weight:700;"><span style="font-weight:700;">android:layout_width= "</span></span><span style="font-weight:700;"><span style="font-weight:700;"> <span>fill_parent</span>"</span></span>---------settings<span style="font-weight:700;"><span style="font-weight:700;">fill_parent</span></span>, let the width be generated by scale<br><span style="font-weight:700;"><span style="font-weight:700;">android:layout_weight= "1"</span></span><br>android:layout_height= "50dp"/><br><button<br>Android:id= "@+id/first_sex1_5"<br>android:layout_marginleft= "5dp"<br><span style="font-weight:700;"><span style="font-weight:700;">android:layout_width= "</span></span><span style="font-weight:700;"><span style="font-weight:700;"> <span>fill_parent</span>"</span></span><br><span style="font-weight:700;"><span style="font-weight:700;">android:layout_weight= "3"</span></span><br>android:layout_height= "50dp"/><br></LinearLayout></span></span></p><p><p><span style="color:#000;"><span style="font-family:Helvetica, Tahoma, Arial, sans-serif;">Note Now <span style="font-weight:700;">android:layout_width= "</span><span style="font-weight:700;"><span><span>fill_parent</span></span>"</span></span></span></p></p><p><p><span style="color:#000;"><span style="font-family:Helvetica, Tahoma, Arial, sans-serif;">The final 3 buttons display a width ratio of 3:1, and weight opposite, The value of a large weight is low, the display width is small</span></span></p></p></td> </tr> </tbody> </table><p><p><br></p></p><p><p>Use of Android:weight</p></p></span>

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.