Android setting Button width half the screen

noor

New Member
How to setup(in XML) that the button will have width half of screen. I found only wrap conetnt, match parent(fills whole screen) and exact ammount of dp eg: 50dp.How to set it exacly hald the screen?\[code\]<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent" android:weightSum="2"> <Button android:id="@+id/buttonCollect" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:paddingLeft="8dp" android:paddingRight="8dp" android:text="przycisk" /><Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:text="Button" />\[/code\]
 
Back
Top