All attributes have to be declared in res/values/attrs.xml. You can look at the example of Home in the samples that come with the SDK. It shows how to create a custom widget and its XML attributes.
On Mon, Jan 26, 2009 at 11:53 AM, Wick <[email protected]> wrote: > > In the XML Layout files, how are the key elements such as 'Button' and > 'TextView' linked to their actual classes? I am using a new sliding > panel class (extending LinearLayout), but I cannot manage to add it to > a layout file. The class is contained in android.widget.Panel. > > An example of my attempts at a layout file are below. When I make > with this file, I get the error > > packages/apps/Camera/res/layout/viewimage.xml:27: ERROR Error parsing > XML: unbound prefix > > Line 27 is where I declare the new Panel in the xml > (<android.widget.Panel ......). It is as if it doesn't know what > element I'm referring to. > > ***code*** > > <FrameLayout xmlns:android="http://schemas.android.com/apk/res/ > android" > xmlns:panel="http://schemas.android.com/apk/res/org.panel" > android:layout_width="fill_parent" > android:layout_height="fill_parent" > android:background="#767c9b" >> > <LinearLayout > android:orientation="vertical" > android:layout_width="fill_parent" > android:layout_height="fill_parent" > > > <android.widget.Panel > android:layout_width="fill_parent" > android:layout_height="wrap_content" > android:id="@+id/topPanel" > android:paddingBottom="20dip" > panel:position="top" > panel:animationDuration="1000" > > panel:openedHandle="@drawable/top_switcher_expanded_background" > > panel:closedHandle="@drawable/top_switcher_collapsed_background" > > > <Button > android:id="@id/panelHandle" > android:layout_width="fill_parent" > android:layout_height="33dip" > /> > </android.widget.Panel> > </LinearLayout> > </FrameLayout> > > *** end of code *** > > Please help me out. > > Thanks > > > > -- Romain Guy Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

