3
我想在android中创建一个自定义视图(或更好的布局),作为2个子视图的容器(将其视为一个将2个容器垂直分隔的条,可以上下滑动)。Android:创建一个自定义的容器视图
我想将它用作xml中的布局,以便您可以在其中嵌套任何视图。 我想到了这样的事情:
<view class="at.calista.quatscha.views.SwipebarLayout"
android:id="@+id/sbl"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<!-- Top View -->
<Button android:text="Top" android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
<!-- Bottom View -->
<Button android:text="Bottom" android:id="@+id/Button02" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</view>
这个XML应该给我两个按键之间的滑动式酒吧。
但是,我不知道如何实现这一点,我正在扩展LinearLayout atm,但我该如何告诉我的孩子如何定位自己?的
那么,我如何得到在代码中定义的布局的孩子。 – AndroidDev 2012-09-27 13:44:59