我有一个问题,我已经试着用搜索引擎和其他方式寻找,但我不知道该怎么寻找...Android的布局XML属性和定位...
我的布局是这样的:
_______________________________________________________
| | | |
| | | |
| content | button | |
| | | |
|___________|________|__________________________________|
但如果我补充一点它看起来就像这样:
_______________________________________________________
| | | |
| | | |
| content | button | |
| | | |
|_________________________|________|____________________|
但当含量低于包装大我要让内容滚动,但显示出在包装结束按钮喜欢这样的:
_______________________________________________________
| | |
| | |
| scrollable content | button |
| | |
|______________________________________________|________|
所以它不会不管有多少内容有,该按钮将始终可见,内容将是horizontaly scollable :)
我的代码,现在是这样的,但我不知道我该怎么做,我可以得到它像我想要的:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="@dimen/TopBarHeight" >
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="@dimen/TopBarHeight" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="@dimen/TopBarHeight" >
<LinearLayout
android:layout_width="@dimen/TabMaxWidth"
android:layout_height="@dimen/TopBarHeight" />
<LinearLayout
android:layout_width="@dimen/TabMaxWidth"
android:layout_height="@dimen/TopBarHeight" />
<LinearLayout
android:layout_width="@dimen/TabMaxWidth"
android:layout_height="@dimen/TopBarHeight" />
<LinearLayout
android:layout_width="@dimen/TabMaxWidth"
android:layout_height="@dimen/TopBarHeight" />
<LinearLayout
android:layout_width="@dimen/TabMaxWidth"
android:layout_height="@dimen/TopBarHeight" />
<LinearLayout
android:layout_width="@dimen/TabMaxWidth"
android:layout_height="@dimen/TopBarHeight" />
</LinearLayout>
</HorizontalScrollView>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="@dimen/TopBarHeight" >
<ImageButton
android:layout_width="@dimen/TopBarHeight"
android:layout_height="@dimen/TopBarHeight"/>
</LinearLayout>
</LinearLayout>
您是否试图将您的linearlayout与您的按钮放在horizontalscrollview中? – maebe 2012-02-28 11:31:58
如果我这样做,按钮VILL disapear时滚动视图充满 – Alioooop 2012-02-28 11:44:40