android的Gridlayout问题

imsorrybut imsorrybut 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
android新手来的,我想让GridLayout第一行的四个按钮填充第一行,为何最后总是留有空隙呢?
代码如下:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="100px"
android:orientation="vertical" >

<GridLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnCount="4"
android:orientation="horizontal"
android:rowCount="1" >

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/backgroundphoto"
android:drawableTop="@drawable/call"
android:text="@string/phone" />

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/backgroundphoto"
android:drawableTop="@drawable/star"
android:text="@string/collect" />

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/backgroundphoto"
android:drawableTop="@drawable/single"
android:text="@string/communicater" />

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/backgroundphoto"
android:drawableTop="@drawable/doubles"
android:text="@string/doubles" />
</GridLayout>
</LinearLayout>

</LinearLayout>

...全文
评论 14
收藏 已收藏
分享
返回顶部
imsorrybut
Android 80,489 成员 91,375 内容