내가하려는 것은 TableLayout
에서 모든 패딩 및 여백을 제거하고 바둑판 식으로 배열 된 자식 버튼을 표시하는 것입니다. Android TableLayout 패딩 제거
이
이 내가 무엇을 얻을<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".Main"
android:orientation="horizontal"
android:baselineAligned="false">
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="@+id/button1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="@+id/button4" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="@+id/button2" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="@+id/button3" />
</TableRow>
</TableLayout>
모든 패딩은 0
로 설정되어있는 activity_main.xml
코드 :
그리고이 난 것입니다 시도 :
당신은 당신이 사용하고있는 API를 wrap_content – geekCode
를 사용해야합니까? –
맞습니다. 그러나 API 레벨 14를 사용하고 있습니다 – bukk530