任何人都有想法,我該如何做這個GridView?我如何在android中執行此佈局
我認爲它的ImageView與頂部圓潤的背景下,但圖像的底部?我沒有想法。
這是我的代碼:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
android:id="@+id/panel_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:background="#686868">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#686868">
<com.etsy.android.grid.util.DynamicHeightImageView
android:id="@+id/grid_item_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:focusableInTouchMode="false"
android:layout_above="@+id/linearLayout"
android:layout_marginBottom="8dp"
android:scaleType="fitCenter"
android:background="@drawable/shadow" />
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/btnDeletePhoto"
bootstrapbutton:bb_size="small"
android:layout_width="wrap_content"
bootstrapbutton:bb_icon_right="fa-trash-o"
bootstrapbutton:bb_type="danger"
android:layout_height="wrap_content"
android:layout_gravity="center|right"
android:layout_margin="4dp"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:layout_toEndOf="@id/grid_item_image"
android:layout_alignParentEnd="false"
android:layout_alignParentRight="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="@drawable/bg_card"
android:id="@+id/linearLayout"
android:gravity="end"
android:weightSum="1">
<com.etsy.android.grid.util.DynamicHeightTextView
android:id="@+id/photoDesc"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Descrpciooon blablabla"
android:textColor="#9A9A9A"
android:maxLength="15"
android:padding="4dp"
android:singleLine="true"
android:textStyle="bold"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="1dp"
android:layout_weight="1" />
</LinearLayout>
</RelativeLayout>
</FrameLayout>
這是我的結果:
我需要的東西XML做我的例子中的類似底部。 任何人都有這樣的例子嗎?我嘗試使用card-ui xml佈局,但它不是這樣。 謝謝。
你能提供更多關於「圖像底部」的信息嗎? – Libin
是的,我想做任何事情,像我的圖像example.I將把圖像與我的結果 – colymore
作爲一個白色的邊框與文字0123'你需要所有的邊的圓角。對? – Libin