你在xml文件中,使用你自定义的控件就好了,然后就可以R.layout.xxxxx

解决方案 »

  1.   

    在布局文件中添加你的这个view的节点就好了。   
    节点名字是你这个view的类名(<com.xx.xx.xx />)
      

  2.   

    如果你包名为com.android.test,类名为HelloWorld,在xml文件中引用为:<com.android.test.HelloWorld />
      

  3.   

    建议网上搜搜自定义View实现,以及一些自定义属性Attribute等等。
     
            基本用法同LS的。   
         
      

  4.   

    用viewgroup,我做的程序界面,就是几个自定义view组合的。
      

  5.   

    <com.honda.hondalink.ev.component.InterceptScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:charge="http://schemas.android.com/apk/res/com.hondalink.ev"
        android:id="@+id/scrollview_id"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:fadingEdge="none"
        android:fillViewport="true"
        android:focusable="false"
        android:orientation="vertical"
        android:scrollbars="none" >
      

  6.   

    例: 自定义TextView:
    <com.crosscountryauto.rsa.component.RSATextView
                    android:id="@+id/TextViewServiceProviderAddressId"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    fontStyle="trebuc"
                    android:background="@drawable/oem_9_location"
                    android:gravity="top"
                    android:paddingBottom="20dp"
                    android:paddingLeft="20dp"
                    android:paddingRight="20dp"
                    android:paddingTop="20dp"
                    android:singleLine="false"
                    android:textColor="@color/textgray2"
                    android:textSize="15.5sp" />
      

  7.   

    <cn.com.smarthome.activity.MainView
    android:id="@+id/mainView" android:layout_width="150dip"
    android:layout_height="150dip" />