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