obernardovieira

[Android] 50% layout_weight

May 14th, 2014
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 0.59 KB | None | 0 0
  1. // not by me
  2. // http://www.hrupin.com/2012/02/how-to-set-view-width-height-in-percentage-of-parent-view-in-android
  3.  
  4.  
  5. <?xml version="1.0" encoding="utf-8"?>
  6. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  7.     android:orientation="vertical"
  8.     android:layout_width="match_parent"
  9.     android:layout_height="match_parent"
  10.     android:weightSum="100">
  11.     <LinearLayout android:layout_weight="50"
  12.         android:layout_width="match_parent"
  13.         android:id="@+id/linearLayout1"
  14.         android:layout_height="wrap_content"
  15.         android:orientation="vertical"></LinearLayout>
  16. </LinearLayout>
Add Comment
Please, Sign In to add comment