其中用到了TableRow,把Button包在里面了,我想问一下怎么调整他们之间的距离,就是感觉之间空白太多了。
加粗文字
<?xml version="1.0" encoding="utf-8"?><!--发现首页面-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="5dp">
<!--此处是发现的首页-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerInside"
android:src="@drawable/test" />
</LinearLayout>
<!-- 第一行-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<!--自动推上去的页面-->
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:stretchColumns="*">
<TableRow>
<Button
android:id="@+id/find_btn_1"
android:layout_width="1dip"
android:layout_height="wrap_content" />
<Button
android:id="@+id/find_btn_2"
android:layout_width="1dip"
android:layout_height="wrap_content"
android:text="test" />
</TableRow>
<TableRow>
<Button
android:id="@+id/find_btn_3"
android:layout_width="1dip"
android:layout_height="wrap_content"
android:text="test" />
<Button
android:id="@+id/find_btn_4"
android:layout_width="1dip"
android:layout_height="wrap_content"
android:text="test" />
</TableRow>
<TextView
android:id="@+id/tv"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</TableLayout>
</LinearLayout>
<!-- 第二行-->
<!-- 热门新闻-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="@+id/find_hotnews"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="热门新闻/已经做了" />
<Button
android:id="@+id/btn_find_around"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="附件的新闻/好友" />
<Button
android:id="@+id/fin_btn_health"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="健康水平测试" />
</LinearLayout>
</LinearLayout>
</ScrollView>
外边距: