Horizontal ListView with parchment library error

303 views Asked by At

I m just trying to use parchment library to add an horizontal listView but it doesn't work for me.

I followed all the instructions to add parchment as an Android library in Eclipse and it's ok for this step. The problem is that when i'm trying to add my horizontal listView in xml file Eclipse shows the error : " Error: String types not allowed (at 'orientation' with value 'horizontal ')"

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        <View
            android:layout_width="wrap_content"
            android:layout_height="60dp"
            android:background="#ff5a5bff"/>


        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="List App"
            android:textColor="#fff"
            android:textSize="25sp"
            android:gravity="center_vertical"
            android:layout_centerInParent="true"/>
    </RelativeLayout>

    <mobi.parchment.widget.adapterview.listview.ListView 
            xmlns:parchment="http://schemas.android.com/apk/res/res-auto"
            android:id="@+id/list"
            android:layout_width="match_parent"
            android:layout_height="200dp"
            android:clipToPadding="true"
            android:drawSelectorOnTop="false"
            parchment:orientation="horizontal"
            parchment:snapPosition="start"/>

</LinearLayout>

Can you please help

Thank's a lot

2

There are 2 answers

0
petey On BEST ANSWER

Add the following to your root tag, xmlns:parchment="http://schemas.android.com/apk/res-auto

Also your LinearLayout.TextView 60 dp centered(vertical text)may be simplified

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:parchment="http://schemas.android.com/apk/res-auto">


        <TextView
            android:layout_width="wrap_content"
            android:layout_height="60dp"
            android:text="List App"
            android:background="#ff5a5bff"
            android:textColor="#fff"
            android:textSize="25sp"
            android:gravity="center_vertical" />
1
mariopce On

in documentation xmlns is: xmlns:parchment="http://schemas.android.com/apk/res/<YOUR PACKAGE NAME>" and in your code is a: xmlns:parchment="http://schemas.android.com/apk/res/res-auto" Please check this