0

i just export a package to make a carousel to my project in xml file :

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >


    <ListView 
        android:id="@+android:id/list1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"></ListView>

   <LinearLayout
        android:layout_weight="1"
        android:padding="5dip"
        android:gravity="top"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        >
        <com.me.controls.Carousel
                android:layout_width="fill_parent"
                android:layout_height="fill_parent" 
                android:id="@+id/carousel"  
                pj:UseReflection="true"
                pj:Items="@array/entries" 
                pj:SelectedItem="0"
                android:animationDuration="200"
            />  
</LinearLayout>             
</LinearLayout>

when run it gives error:error Parsing XML: unbound prefix. but i don't know the reason please any one help??

Chirag
  • 56,621
  • 29
  • 151
  • 198
loleana
  • 37
  • 7
  • Try to write "android:orientation="vertical" " this line also for linearLayout which is inside of your listView.. – yahya Aug 16 '12 at 09:54
  • Just realized, as i know you shouldn't use android:layout_width="fill_parent" with android:layout_weight="1".. try to set android:layout_width="0px" if you need to use weight. – yahya Aug 16 '12 at 09:56
  • my problem not in listView te list works good the error occure in – loleana Aug 16 '12 at 10:06
  • The issue is caused by these "pj:UseReflection="true" pj:Items="@array/entries" pj:SelectedItem="0"" attributes. You need to add a (valid) namespace for them - just as "android:" is declared in the start of your document. – Jens Aug 16 '12 at 10:23
  • http://stackoverflow.com/a/8003730/1012284 – Padma Kumar Aug 16 '12 at 10:40
  • i added it but it gave an error :no resource idintifir found for attribute Items & SelectedItem I already defined them in attr.xml in a values @Jens – loleana Aug 22 '12 at 07:15
  • @loleana you should probably update your question with the fixed layout and the attr.xml you've defined. – Jens Aug 22 '12 at 10:00

2 Answers2

2

//you created id for listview is wrong

android:id="@+android:id/list1"

try this below one

android:id="@android:id/list"
Padma Kumar
  • 19,893
  • 17
  • 73
  • 130
1

You need to define name space here to use custom view's attributes.

Have a look at this question.

Community
  • 1
  • 1
Chitranshu Asthana
  • 1,089
  • 8
  • 19