ich Zentrierung richtig, wie Sie sehen können, wenn Sie das content_main.xml Design RegisterkarteBei der vertikalen Zentrierung, wie wird die Aktionsleiste berücksichtigt?
jedoch sehen, wenn man sich activity_main.xml Design mit der Aktionsleiste an Ort und Stelle, während sie ist immer noch in der App zentriert, es ist nicht in den Whitespace zentriert, was ich bevorzugen würde. Irgendwelche Vorschläge, wie die Aktionsleiste zu berücksichtigen ist? Vorzugsweise in der XML wenn möglich.
Hier ist meine XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/voting_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:orientation="vertical"
android:layout_gravity="fill_vertical|center"
android:configChanges="orientation|screenSize"
android:screenOrientation="nosensor"
tools:context="com.gesslar.threshvote.MainActivity"
android:background="@color/colorFaded"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/activity_main">
<TextView android:id="@+id/textStatusMessage"
android:textColor="@color/colorText"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center" />
<ImageButton android:id="@+id/buttonVote"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="false"
android:src="@drawable/ic_vote_button_image"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@android:color/transparent"
android:scaleType="fitCenter"
android:onClick="onVotePressed"
android:layout_gravity="center_horizontal|center_vertical"
android:adjustViewBounds="true"
android:contentDescription="@string/desc_vote_button" />
<TextSwitcher android:id="@+id/textCountdown"
android:gravity="center"
android:layout_gravity="center_horizontal"
android:textColor="@color/colorText"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="@dimen/countdown"
android:includeFontPadding="false"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ProgressBar android:id="@+id/loadingBar"
style="@style/Widget.AppCompat.ProgressBar"
android:layout_gravity="end"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:indeterminate="true"/>
</LinearLayout>
Ich habe aktualisiert, um meine XML zu enthalten, die ich in erster Linie hätte tun sollen. Das tut mir leid. –