8
我有一個小的佈局在API 19:4.2.2上正常工作,但無法使其在API 21:5.0.1上工作。RelativeLayout zorder棒棒糖
這裏的佈局:
<?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" >
<Button
android:id="@+id/start_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textStyle="bold"
android:textSize="30sp"
android:background="@color/start_button_bg"
android:textColor="@color/start_button_text"
android:text="@string/start_process"/>
<TextView
android:id="@+id/pro_icon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:textColor="@android:color/white"
android:background="@drawable/pro_icon"
android:text="PRO"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</RelativeLayout>
真的簡單的東西。我只是想讓textview在相對佈局中位於Button之上。我知道相對佈局堆棧視圖按照它們在xml中添加的順序排列,但這似乎在棒棒糖上的工作方式不同。我無法讓TextView在按鈕上呈現。任何想法?
乾杯。
沒有注意到海拔屬性。謝謝。另一方面,在改變視圖高程時有沒有辦法去除陰影? – Notbad
@Notbad:可能吧,但我不知道這個技巧。 – CommonsWare