0
我写了自己的视图栏,它扩展了LinearLayout
。我的酒吧有两个地方用于添加按钮或其他视图。使我的视图能够接受xml中的子视图
bar.addItemToLeft(view);
或 bar.addItemToRight(view);
我想提出我的酒吧能接受孩子的在XML视图中象LinearLayout
:我现在使用的代码,如项目添加到我的吧。
例如:
<com.my.ui.Bar
android:id="@+id/bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<com.my.ui.BarLeft
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<View/> <View/> <View/>
</com.my.ui.BarLeft>
<com.my.ui.BarRight
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<View/> <View/> <View/>
</com.my.ui.BarLeft>
</com.my.ui.Bar>
是否possiable办?
PS:
我的左,右孩子的地方已经扩展的LinearLayout。 – Nik
然后,您必须能够像使用LinearLayouts一样将控件添加到布局中。 –
请看图像顶部。显示地点,我想要添加项目。 – Nik