0
我想在按鈕上方顯示TextView,但在API 21上方的TextView上方顯示按鈕。TextView不會顯示在按鈕上方超過API 21
我嘗試android:elevation
但它作出的TextView陰影,這是不好的。
我嘗試android:translationZ="100dip"
但沒有工作。
我的XML代碼:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:layout_margin="10dp">
<Button
android:id="@+id/custom_listview_food"
android:text="@string/main_matrial1"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:padding="10dp"
android:gravity="center_horizontal"
android:textSize="16sp"
android:background="@color/listview_matrial"
android:layout_marginBottom="5dp"
/>
<TextView
android:id="@+id/custom_listview_material1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="material 1"
android:textColor="@color/white"
android:textSize="20sp"
android:layout_alignRight="@id/custom_listview_food"
android:layout_marginTop="50dp"
android:layout_marginRight="10dp"
/>
</RelativeLayout>
感謝,但與此代碼,它們只是改變了他們的position.I想要的TextView下按鈕進入。請看圖片 – Arash