Percentage library not working properly

255 Views Asked by At

I have an adapter class in which I have a layout

<android.support.percent.PercentRelativeLayout
    android:id="@+id/relayout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical"
    android:layout_margin="5dp">
    <ImageView
        android:id="@+id/imageView"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_heightPercent="40%"
        app:layout_widthPercent="25%"
        android:src="@drawable/fairytail_button_selector"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true" />

    <TextView
        android:id="@+id/txtlabel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/imageView"
        android:layout_centerHorizontal="true"
        android:textColor="@android:color/white" />

</android.support.percent.PercentRelativeLayout>

I am using percentage library to make UI same on all devices but its show nothing when I run this on my mobile device, I am using same library for my other layouts it works perfectly but when I call this layout in adapter class in getview method it display nothing. But if I use simple Relative layout instead of android.support.percent.PercentRelativeLayout it shows everything fine please help me what I am doing wrong

0

There are 0 best solutions below