Будучи новым для android, я все еще изучаю тонкости макетов. Я пытаюсь создать простой бар поверх карты. По большей части это прекрасно работает.Android LinearLayout Alignment
Моя проблема в том, что я хочу, чтобы все было правильно выровнено, за исключением кнопки, которую я хочу оставить влево. Я попробовал несколько комбинаций и не смог получить желаемый макет.
Это начинает заставлять меня думать, что моя структура в целом неверна. Кажется, должно быть легко исправить. Что мне не хватает?
<LinearLayout
android:id="@+id/transparent_panel_hud"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="right">
<Button
android:text="View"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="@drawable/arrow_down"
android:textSize="10sp"
android:drawablePadding="3dp"/>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingRight="15dp" >
<TextView
android:id="@+id/latitude"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:gravity="right"
android:text="@string/default_latitude"
android:textSize="18sp" />
<TextView
android:id="@+id/longitude"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="@string/default_longitude"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingRight="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/speed"
android:textSize="18sp" />
<TextView
android:id="@+id/speed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/default_speed"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingRight="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/heading"
android:textSize="18sp" />
<TextView
android:id="@+id/heading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/default_heading"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>![screenie][1]
@J. Скарбо, у тебя был ответ? Если нет, проверьте этот ответ. –
Это работает отлично. Спасибо. –