【发布时间】:2016-06-28 03:26:36
【问题描述】:
我的问题是所有这些视图都有不同的左填充,当我将它们放在另一个下方时,它看起来很乱。
我该如何解决?有什么很酷的方法可以解决这个问题吗?
我尝试添加一些额外的填充,例如用于编辑文本的 2dp 和用于文本视图的 4dp,但由于不同设备上的填充不同,它似乎不起作用。
示例(在 Google 的官方应用程序中并非如此): 在我的布局中没有什么特别之处,只是没有任何附加属性的视图。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dip">
<EditText
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/network_password"
android:inputType="textPassword"/>
</android.support.design.widget.TextInputLayout>
<CheckBox
android:id="@+id/checkbox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/show_password"/>
</LinearLayout>
【问题讨论】:
-
请分享您的布局。
标签: android