有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何更改GridView的设计项?安卓

我想在GridView中更改我项目的设计

现在是:

SCREENSHOT

我希望这个项目在方形,而不是像它现在在矩形。 此外,IMG(来自截图)我希望上面的“名称”和中心的每个文本视图。可能吗?以下是我的XML:

    <?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:安卓="http://schemas.安卓.com/apk/res/安卓"
    安卓:layout_width="match_parent"
    安卓:layout_height="match_parent"
    安卓:background="@color/md_brown_100"
    安卓:orientation="vertical"
    安卓:gravity="center"
    安卓:paddingTop="10dp"
    安卓:paddingBottom="10dp" >

    <TextView
        安卓:id="@+id/credit_wallet"
        安卓:text="@string/hi"
        安卓:gravity="center"
        安卓:textColor="@color/md_brown_700"
安卓:layout_marginTop="20dp"
        安卓:layout_width="match_parent"
        安卓:layout_height="wrap_content"
        安卓:layout_alignParentTop="true"
        />
    <com.justfashion.Logo

        安卓:text="Fashion Wallet"
        安卓:gravity="center"
        安卓:textColor="@color/md_brown_700"
        安卓:layout_marginTop="25dp"
        安卓:layout_width="match_parent"
        安卓:layout_height="wrap_content"
        安卓:layout_alignParentTop="true"
        />




    <LinearLayout 安卓:id="@+id/list_offer_item_container"
    安卓:layout_marginTop="15dp"
        安卓:layout_below="@id/text"
        安卓:layout_marginLeft="1dp"
        安卓:layout_marginRight="1dp"
        安卓:layout_width="wrap_content"
        安卓:layout_height="wrap_content"
        安卓:background="@drawable/shape"
        安卓:gravity="center"
        安卓:paddingTop="10dp"
        安卓:paddingBottom="10dp">

        <LinearLayout
            安卓:layout_width="0dp"
            安卓:layout_weight="1"
            安卓:layout_height="match_parent"
            安卓:gravity="center"
            安卓:orientation="vertical" >

            <TextView
                安卓:id="@+id/txtname"
                安卓:layout_width="wrap_content"
                安卓:layout_height="wrap_content"
                安卓:gravity="center"
                安卓:layout_marginTop="1dp"
                安卓:textColor="#48899f"
                安卓:textSize="@dimen/textsizeearncredit_title"
                安卓:text="Name"
                安卓:textAllCaps="false"
                安卓:textStyle="normal|bold" />

            <TextView
                安卓:id="@+id/txtdesc"
                安卓:layout_width="wrap_content"
                安卓:layout_height="wrap_content"
                安卓:layout_marginTop="1dp"
                安卓:maxLines="1"
                安卓:textColor="#80869c"
                安卓:textSize="@dimen/textsizeearncredit_desc"
                安卓:text="This is a description of the offer and this is just a demo to show off 3 lines stacking correctly on top of each other"/>
        </LinearLayout>

        <LinearLayout
            安卓:layout_width="wrap_content"
            安卓:layout_height="wrap_content"
            安卓:orientation="vertical"
            安卓:gravity="center"

            安卓:layout_gravity="center_vertical">

            <TextView 安卓:id="@+id/list_offer_badge_text"
                安卓:layout_width="wrap_content"
                安卓:layout_height="wrap_content"
                安卓:layout_above="@+id/list_offer_item_container"
                安卓:textColor="@color/md_amber_700"
                安卓:textSize="12sp"
                安卓:visibility="gone"
                安卓:text=""/>
        </LinearLayout>

        <ImageView
            安卓:id="@+id/imgcreditcompany"
            安卓:layout_width="42dp"
            安卓:layout_above="@+id/txtname"
              安卓:contentDescription="@string/app_name"
            安卓:gravity="center"

            安卓:layout_height="42dp" />

        <ImageView
            安卓:id="@+id/nextArrow"
            安卓:layout_alignParentRight="true"
            安卓:tint="@color/md_grey_300"
            安卓:rotation="180"
            安卓:layout_width="32dp"
            安卓:visibility="gone"
            安卓:layout_marginRight="16dp"
            安卓:layout_gravity="center"
            安卓:layout_centerVertical="true"
            安卓:layout_height="32dp"
            安卓:contentDescription="@string/app_name"
            安卓:padding="@dimen/two" />

    </LinearLayout>


</RelativeLayout>

我尝试了很多组合,但都不起作用。请帮帮我,伙计们!谢谢

编辑

截图中的IMG是

 <ImageView
            安卓:id="@+id/imgcreditcompany"
            安卓:layout_width="42dp"
            安卓:layout_above="@+id/txtname"
              安卓:contentDescription="@string/app_name"
            安卓:gravity="center"

            安卓:layout_height="42dp" />

在上面的代码中


共 (0) 个答案