我是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