android怎么把一个view放入xml中 你在xml文件中,使用你自定义的控件就好了,然后就可以R.layout.xxxxx 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在布局文件中添加你的这个view的节点就好了。 节点名字是你这个view的类名(<com.xx.xx.xx />) 如果你包名为com.android.test,类名为HelloWorld,在xml文件中引用为:<com.android.test.HelloWorld /> 建议网上搜搜自定义View实现,以及一些自定义属性Attribute等等。 基本用法同LS的。 用viewgroup,我做的程序界面,就是几个自定义view组合的。 <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" > 例: 自定义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" /> <cn.com.smarthome.activity.MainView android:id="@+id/mainView" android:layout_width="150dip" android:layout_height="150dip" /> 基于asmack的android应用在关闭数据连接后重新打开,如何实现自动重连? 如何在GLThread中接收消息? 做过真正产品的回答:安装新版本,如何覆盖安装以保留旧版本的数据 关于监测数据库SQLite的变化 双击DDMS.bat无法运行 有人用过HttpConnector类么? 有没有人做过手写识别的程序的? android 创建控件create和findViewById的区别 有没有遇到这样情况的 急!找不到android studio3.0控件的属性信息面板 Android SDK android布局中自动换行的问题
节点名字是你这个view的类名(<com.xx.xx.xx />)
基本用法同LS的。
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" >
<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" />
android:id="@+id/mainView" android:layout_width="150dip"
android:layout_height="150dip" />