我有了膨脹的ViewHolder以下佈局的RecyclerView沒有顯示出與layout_height =「match_parent」孩子:API19與layout_height =「WRAP_CONTENT」一RelativeLayout的在RecyclerView
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.percent.PercentRelativeLayout
android:id="@+id/imageRelative"
....
....
<LinearLayout
android:id="@+id/premiumBlockerView"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:alpha="0.5"
android:background="@color/Black"
android:layout_alignBottom="@id/linearLayout1" />
</RelativeLayout>
的RelativeLayout的內容變化(圖像,視頻,文本等),所以我無法知道高度(寬度是設備的寬度)。
我必須添加一個視圖(我的premiumBlockerView的LinearLayout),我將顯示爲半透明玻璃或不依賴於內容的類型。
的問題是,在premiumBlockerView高度= match_parent不起作用,這是百達爲零。因此,像其他人張貼的建議,我添加了layout_alignParent和alignBottom參數,這項工作角落找尋解決方案適用於API的超過20
更大的屬性格式現在,應用程序必須爲API 19工作,這項工作以防萬一不起作用。
你有什麼建議嗎?
謝謝!