I am trying to create a custom view (or better, a layout) in android that serves as a container for two child views (think of it as a panel that divides 2 containers vertically that can be scrolled up and down).
I would like to use it as a layout in xml so that you can embed all kinds into it. I thought of something like this:
<view class="at.calista.quatscha.views.SwipebarLayout"
android:id="@+id/sbl"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button android:text="Top" android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
<Button android:text="Bottom" android:id="@+id/Button02" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</view>
This xml should give me a scrollable bar between two buttons.
However, I do not know how to do this, I am expanding LinearLayout atm, but how will I tell my children how to position myself?
source
share