私はAndroidが初めてで(Visual Studioで開発するために使用されていました...)、これまでのところレイアウトに疑問があります:
私がやりたいのは、上部にバーがあるレイアウト (ボタンや追加情報を配置するためだけ) と、画面の残りの部分を埋めるスクロール ビューです。これは私がこれまでにやっている方法です:
<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>
これは期待どおりに機能していますが、私の質問は、正しい方法で行っているのか、より良い方法 (最も効率的な方法) で行うべきかということです。
前もって感謝します