How to split an Android XML into three equal layout rectangles? -


how split android xml view 3 equal layout rectangles image below?

enter image description here

you want use vertical linearlayout, this:

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical"     android:weightsum="3" >      <framelayout         android:layout_width="fill_parent"         android:layout_height="0dip"         android:layout_weight="1"         android:background="#ff0000" >     </framelayout>     <framelayout         android:layout_width="fill_parent"         android:layout_height="0dip"         android:layout_weight="1"         android:background="#00ff00" >     </framelayout>     <framelayout         android:layout_width="fill_parent"         android:layout_height="0dip"         android:layout_weight="1"         android:background="#0000ff" >     </framelayout>  </linearlayout> 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -