gpt4 book ai didi

java - 调整gridview和按钮的roe

转载 作者:行者123 更新时间:2023-12-01 14:03:44 25 4
gpt4 key购买 nike

  • 我正在尝试调整 GridView 和按钮之间的空间
  • 我已经发布了图
  • 我正在努力实现这一目标

XML

<?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" >

<!-- Top navigation bar for Restaurant Description Page -->

<TableRow
android:id="@+id/tableRow6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="2sp" >

<RelativeLayout
android:id="@+id/TopNavigationBarRestaurantDesc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#726E6D" >

<!-- Back Button -->

<Button
android:id="@+id/TopNavigationBarRestaurantDescActivityBackButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="BACK"
android:textColor="@android:color/white"
android:textSize="12sp" />

<!-- Restaurant Description page name -->

<TextView
android:id="@+id/TopNavigationBarRestaurantDescActivityName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="TextView"
android:textColor="@android:color/white"
android:textSize="18sp"
android:textStyle="bold" />

<!-- Restaurant Description page Image -->

<ImageView
android:id="@+id/TopNavigationBarRestaurantDescActivityImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
</TableRow>

<TableRow
android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="2sp" >

<TextView
android:id="@+id/RestaurantTimingsID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Timings"
android:textStyle="bold" />
</TableRow>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp" >
</LinearLayout>

<TableRow
android:id="@+id/BuyReservedButtonRow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="2sp" >

<Button
android:id="@+id/BuyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/buy_button_shape"
android:paddingBottom="13dp"
android:paddingLeft="16dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Buy"
android:textColor="@android:color/white" />

<TextView
android:id="@+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="6sp" />

<Button
android:id="@+id/ReservedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/reserverd_button_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Reserve"
android:textColor="@android:color/white" />
</TableRow>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp" >
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<TableRow
android:id="@+id/DescriptionTitleRow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="2sp" >

<GridView
android:id="@+id/listview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnWidth="80dp"
android:gravity="center"
android:numColumns="3"
android:scrollbars="horizontal"
android:stretchMode="spacingWidthUniform" >
</GridView>
</TableRow>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp" >
</LinearLayout>

<TableRow
android:id="@+id/tableRow5"
android:layout_width="match_parent"
android:layout_height="wrap_content" >

<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal" >

<Button
android:id="@+id/RestaurantDescriptionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Description"
android:textColor="@android:color/white"
android:textSize="11sp" />

<Button
android:id="@+id/RestaurantLocationButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Location"
android:textColor="@android:color/white"
android:textSize="11sp" />

<Button
android:id="@+id/RestaurantPhotosButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Photos"
android:textColor="@android:color/white"
android:textSize="11sp" />

<Button
android:id="@+id/RestaurantFriendsButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Friends"
android:textColor="@android:color/white"
android:textSize="11sp" />
</LinearLayout>
</TableRow>

<TableRow
android:id="@+id/tableRow7"
android:layout_width="match_parent"
android:layout_height="wrap_content" >

<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal" >

<Button
android:id="@+id/RestaurantSearchButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_square_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Search"
android:textColor="@android:color/white"
android:textSize="11sp" />

<Button
android:id="@+id/RestaurantFeaturedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_square_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Featured"
android:textColor="@android:color/white"
android:textSize="11sp" />

<Button
android:id="@+id/RestaurantDealsButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_square_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Deals"
android:textColor="@android:color/white"
android:textSize="11sp" />

<Button
android:id="@+id/RestaurantInviteButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_square_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Invite"
android:textColor="@android:color/white"
android:textSize="11sp" />

<Button
android:id="@+id/RestaurantAccountButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_square_shape"
android:paddingBottom="13dp"
android:paddingLeft="13dp"
android:paddingRight="13dp"
android:paddingTop="13dp"
android:text="Account"
android:textColor="@android:color/white"
android:textSize="11sp" />
</LinearLayout>
</TableRow>
</LinearLayout>

</LinearLayout>

如何删除 GridView 和下面的按钮行之间的空间

如何去掉gridview下面的空格

最佳答案

尝试下面的代码段,替换为您的代码并请检查一次。

<TableRow
android:id="@+id/DescriptionTitleRow"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:padding="2sp" >

<GridView
android:id="@+id/listview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnWidth="80dp"
android:gravity="center"
android:numColumns="3"
android:scrollbars="horizontal"
android:stretchMode="spacingWidthUniform" >
</GridView>
</TableRow>

关于java - 调整gridview和按钮的roe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19109631/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com