Sergey
Sergey

Reputation: 8091

Android: I've build custom view in layout/custom.xml How to know it's package name

I have main.xml and custom.xml

I want that custom.xml will be like user control, so I've put 2 these tags into mail.xml like this:

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

     <custom
         xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_height="wrap_content"
         android:layout_width="fill_parent" />

     <custom
         xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_height="wrap_content"
         android:layout_width="fill_parent" />

</LinearLayout>

But it doesn't work.

Upvotes: 0

Views: 65

Answers (1)

Michael Celey
Michael Celey

Reputation: 12745

Try the include tag instead.

<include layout="@layout/custom"
    android:id="@+id/custom1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" />

Upvotes: 1

Related Questions