输出在特定的Android设备上以不同的方式显示
我在android studio中创建了一个简单的按钮和输出在特定的Android设备上以不同的方式显示,android,xml,Android,Xml,我在android studio中创建了一个简单的按钮和XML上的recyclerview。 对于我尝试过的一些设备,按钮和recyclerview会正常显示。 然而,我提到的这个设备显示的是不同的。 这是一张照片 它应该是正常大小,没有文本被裁剪。 有没有人找到解决这些问题的办法 [编辑] 下面是按钮的相关XML代码 <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schem
XML
上的recyclerview
。
对于我尝试过的一些设备,按钮和recyclerview
会正常显示。
然而,我提到的这个设备显示的是不同的。
这是一张照片
它应该是正常大小,没有文本被裁剪。
有没有人找到解决这些问题的办法
[编辑]
下面是按钮的相关XML
代码
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="left"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Dine In/Take Away"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:padding="10dp"
android:textColor="@color/Black"
android:textStyle="bold"/>
<Spinner
android:id="@+id/spDineIn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:layout_marginBottom="10dp"
android:padding="10dp"
android:spinnerMode="dropdown"
android:entries="@array/array_dine_in"
android:prompt="@string/spinner_dine_in" />
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/etlTableNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:layout_marginTop="10dp">
<EditText
android:id="@+id/etTableNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:hint="Table Number" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/etlQtyCust"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:layout_marginTop="10dp">
<EditText
android:id="@+id/etQtyCust"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:hint="Customer Total" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/etlCustomerName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:layout_marginTop="10dp">
<EditText
android:id="@+id/etCustomerName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Customer Name"
android:inputType="textPersonName" />
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="right"
android:orientation="horizontal">
<Button
android:id="@+id/btnNext"
android:layout_width="110dp"
android:layout_height="55dp"
android:layout_marginTop="8dp"
android:layout_marginRight="8dp"
android:text="Save"
android:textStyle="bold"
android:textColor="@color/ButtonTextColor"
android:background="@drawable/mybutton"
/>
<Button
android:id="@+id/btnMerge"
android:layout_width="110dp"
android:layout_height="55dp"
android:layout_marginTop="8dp"
android:layout_marginRight="8dp"
android:text="Save & Merge"
android:textStyle="bold"
android:textColor="@color/ButtonTextColor"
android:background="@drawable/mybutton"
/>
<Button
android:id="@+id/btnCancel"
android:layout_width="110dp"
android:layout_height="55dp"
android:layout_marginTop="8dp"
android:layout_marginRight="8dp"
android:text="Cancel"
android:textStyle="bold"
android:textColor="@color/ButtonTextColor"
android:background="@drawable/mybutton"
/>
</LinearLayout>
</LinearLayout>
</ScrollView>
TIA将包含按钮的线性布局中的android:gravity=“right”更改为
android:gravity=“center\u vertical”
,请发布相关的xml。如果您可以添加具有正常外观的布局xml和屏幕截图,这将非常有用。为视图创建样式模板,并对该类型的所有视图使用相同的模板谢谢,很抱歉我之前没有使用它,我按照建议输入了xml代码