0
Я создал диалог для ввода некоторых данных, а на некоторых устройствах он не заполняет экран, он, кажется, обертывает содержимое, а на других он заполняет экран (как мне хотелось бы).Диалог не заполняет экран
layout.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
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.support.design.widget.TextInputLayout
android:id="@+id/editSiteLocation_Layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/editSiteLocation"
android:inputType="textCapWords"
android:hint="Site Location"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/editWeatherConditions_Layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/editWeatherConditions"
android:inputType="textCapWords"
android:completionThreshold="1"
android:hint="Weather Conditions"/>
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/buttonAddSite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Add"
android:layout_gravity="end"
style="?attr/buttonBarNegativeButtonStyle"/>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
Я испытал на двух устройствах;
HTC One M9 (отображается, как я хочу)
HTC One M9 (отображается, как я хочу)
Ok спасибо, я отдам это. Любые идеи, почему это проявляется по-разному на подобных подобных устройствах? –
Я думаю, что это то, как поставщики создали собственную сборку Android. Samsung с TouchWiz, Huawei с EMUI и т. Д. – Opiatefuchs
Итак, у меня была возивка, и я обнаружил, что если бы я сделал корневой элемент «RelativeLayout», он также казался желаемым эффектом - на самом деле немного лучше, чем упомянутый вами метод. Я обнаружил, что с использованием описанного вами метода диалог был шире, чем я хотел (разрыв с края экрана до края диалога был примерно вдвое меньше, чем на первом снимке). –