ListView中的Android PercentRelativeLayout不显示任何内容

时间:2016-08-13 19:08:45

标签: android listview android-percentrelativelayout

我正在尝试使用PercentRelativeLayout构建一个ListView,但它什么都没有。

我使用的是Genymotion的自定义手机和4.4.4(API级别19)。

当我切换到LinearLayout的RelativeLayout时,会出现这些项目。在PercentRelativeLayout中,它什么都没有显示。

我做错了什么?

非常感谢您的帮助。

附件是列表视图项的丑陋方案。 图像项目尚未包含在内。

<?xml version="1.0" encoding="utf-8"?>
<android.support.percent.PercentRelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

   <TextView
       android:id="@+id/projects_lv_item_title"
       android:layout_width="match_parent"
       app:layout_heightPercent="50%"
       />

   <TextView
       android:id="@+id/projects_lv_item_desc"
       android:layout_width="match_parent"
       app:layout_heightPercent="50%"
       />



</android.support.percent.PercentRelativeLayout>

enter image description here

2 个答案:

答案 0 :(得分:0)

PercentRelativeLayout添加明确的高度,并为android:layout_height="wrap_content"添加TextView

答案 1 :(得分:0)

我遇到了同样的问题并向谷歌报道

https://code.google.com/p/android/issues/detail?id=202479

同样this是我在堆栈上的问题

相关问题