[英]Width in tablelayout in android not going full screen
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"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.