Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- android:layout_width="100%"
- <android.support.percent.PercentRelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <TextView
- android:layout_height="wrap_content"
- app:layout_widthPercent="35%"
- app:layout_heightPercent="10%"
- app:layout_marginLeftPercent="10%"
- app:layout_marginStartPercent="10%"
- android:text="Some text" />
- <TextView
- android:layout_height="wrap_content"
- android:layout_alignParentEnd="true"
- android:layout_alignParentRight="true"
- android:padding="8dp"
- android:text="Another some text"
- app:layout_marginEndPercent="10%"
- app:layout_marginRightPercent="10%"
- app:layout_widthPercent="35%" />
- </android.support.percent.PercentRelativeLayout>
- <android.support.percent.PercentFrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <Button
- android:background="#f0f0f0"
- app:layout_widthPercent="50%"
- app:layout_heightPercent="50%"
- app:layout_marginTopPercent="25%"
- app:layout_marginLeftPercent="25%" />
- </android.support.percent.PercentFrameLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal" >
- <!-- Эта кнопка занимает 30% от всей ширины -->
- <Button
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="0.3" />
- <!-- Эта - 50% -->
- <Button
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="0.5" />
- <!-- А эта - 20% -->
- <Button
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="0.2" />
- </LinearLayout>
Add Comment
Please, Sign In to add comment