如下图所示,原本是用的偶然发现的如下代码实现的,后发现在2.1版本(也可能包括更低)不能正常显示,不知道应该用什么布局可以实现:
<ScrollView android:layout_width="fill_parent" android:id="@+id/scrollview" android:layout_height="fill_parent"
android:layout_weight="1"
android:fastScrollEnabled="true"
android:focusable="true"
>
<com.xxx.MyView
android:id="@+id/myview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</ScrollView>
好像起神奇作用的是android:layout_weight="1",原理不知,可惜在2.1里不正常。
回答问题要查资料?用《Csdn收音机》可以最快速度搞定!Csdn好帮手——《Csdn收音机》即使监视社区动态!
<ScrollView android:layout_width="fill_parent" android:id="@+id/scrollview" android:layout_height="fill_parent"
android:layout_weight="1"
android:fastScrollEnabled="true"
android:focusable="true"
>
<com.xxx.MyView
android:id="@+id/myview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</ScrollView>
好像起神奇作用的是android:layout_weight="1",原理不知,可惜在2.1里不正常。
回答问题要查资料?用《Csdn收音机》可以最快速度搞定!Csdn好帮手——《Csdn收音机》即使监视社区动态!
你可以用RelativeLyaout试试,把下面的控件设置成在RelativeLyaout的bottom位置显示。
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<SeekBar android:id="@+id/seekbar" android:max="100" android:layout_width="fill_parent" android:layout_height="wrap_content"/>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ScrollView android:layout_width="fill_parent" android:id="@+id/scrollview" android:layout_height="fill_parent"
android:layout_weight="1"
android:fastScrollEnabled="true"
android:background="#220000"
android:focusable="true">
<com.xxx.MyView
android:id="@+id/myview"
android:layout_width="fill_parent"
android:background="#123321"
android:layout_height="fill_parent"/>
</ScrollView>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical"
android:layout_height="wrap_content">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Spinner android:id="@+id/encodes" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
<Button android:text="更多.." android:id="@+id/more" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
<Button android:text="旧版" android:id="@+id/oldver" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button android:id="@+id/prevfile" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="上" />
<Button android:text="下个" android:id="@+id/nextfile" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> <Button android:id="@+id/prevpage" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="上" /><Button android:id="@+id/nextpage" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="下页" />
<Button android:id="@+id/btn_prevline" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="上" /><Button android:id="@+id/btn_nextline" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="下行" />
<Button android:text="Go!" android:id="@+id/speak" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
还在苦苦刷新页面等待回复吗?用《Csdn收音机》告别烦恼!
android:id="@+id/tableLayout1" >
<TableRow android:id="@+id/tableRow2" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_weight="1">
<ScrollView android:layout_width="fill_parent" android:id="@+id/scrollview" android:layout_height="fill_parent"
android:layout_weight="1"
android:fastScrollEnabled="true"
android:focusable="true">
<MyView android:id="@+id/myview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</ScrollView>
</TableRow>
<TableRow android:id="@+id/tableRow3" android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayoutblah,blah,blah...