我是Android新手(用于使用Visual Studio进行开发...),至今我对布局有疑问:Android:顶级菜单栏+滚动视图?
我想要做的是在顶部有一个酒吧的布局(只是放置一些按钮或额外信息)以及填充屏幕其余部分的滚动视图。 这是我做它到目前为止的方式:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Home" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="@android:color/white" >
<!-- I can put any button or text I want in here -->
</LinearLayout>
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="50dp"
android:background="@drawable/wallpaper" >
</ScrollView>
这是工作如我所料,但我的问题是,如果我做了正确的方式还是应该做一个更好的方式(最有效)。
在此先感谢
在ScrollView中删除'android:layout_marginTop =“50dp”'并添加'android:layout_below =“ @ id/linearLayout1“'除此之外你做得很好。 – VenomVendor 2013-03-16 09:44:32