I have following code but width of the button is not full screen. That is small space is left from both sides of the button which I dont want. I want that whole screen width to be covered horizontally.
<TableLayout 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:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="#848484"
tools:context="com.example.bepolite.BePolite" >
<Button
android:id="@+id/sign_up"
android:layout_width="fill_parent"
android:layout_height="80sp"
android:text="Sign Up"
android:textStyle="bold"
android:textColor="#000000"
android:textSize="30sp"
android:background="@drawable/button_signup"
style="?android:attr/borderlessButtonStyle" />
<Button
android:id="@+id/Log_in"
android:layout_width="fill_parent"
android:layout_height="80sp"
android:text="Login"
android:textStyle="bold"
android:textColor="#000000"
android:textSize="30sp"
android:background="@drawable/button_login"
style="?android:attr/borderlessButtonStyle" />
<Button
android:id="@+id/whatisbepolite"
android:layout_width="fill_parent"
android:layout_height="80sp"
android:text="Uderstanding Being Polite???"
android:textStyle="bold"
android:textColor="#000000"
android:textSize="30sp"
android:background="@drawable/button_whatisbeingpolite"
style="?android:attr/borderlessButtonStyle" />
</TableLayout>
Simply remove the padding from the layout. Remove these lines and your view should look fine:
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.