0

I am trying to build a ListView with PercentRelativeLayout, but it draws nothing.

I'm using Genymotion's custom phone with andoird 4.4.4 (API level 19).

When I switch to RelativeLayout of LinearLayout the items appear. In PercentRelativeLayout, it shows nothing.

What am I doing wrong?

Your help would be much appreciated.

Attached is an ugly scheme of the List View item. The image item isn't included yet.

<?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

Onik
  • 19,396
  • 14
  • 68
  • 91
dotaneli
  • 45
  • 11
  • Try to set exact value for **layout_height** in **dp** for the PercentRelativeLayout or set it to **match_parent**. – Todor Kostov Aug 13 '16 at 19:35

1 Answers1

0

Give an explicit height to PercentRelativeLayout, and add android:layout_height="wrap_content" to both TextViews.

Ugurcan Yildirim
  • 5,973
  • 3
  • 42
  • 73