1
我试图在设计我的应用程序时遵循Google的设计指南。我想创建一个单行列表,并且我遵循this page上的指导原则,对于纯文本单行列表。为什么我的布局不符合Google的Material Design Guidelines?
这里是规格:
Font: Roboto Regular 16sp
Tile height: 48dp
Text padding, top: 16dp
Text padding, bottom: 20dp
Bottom padding is measured from the baseline.
和这也显示出左右填充图片:
这里是下面的规格后,我得到的结果:
正如你所看到的,它会被切断。谁在错误?这是我的布局文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="vertical">
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Single-line item"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="16sp"
android:paddingTop="16dp"
android:paddingBottom="20dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"/>
</RelativeLayout>
我试图消除android:textAppearance
线,但它只是改变了文本的颜色。
这里有什么问题?为什么我的布局不符合Google的指南?
我认为问题在'底部填充是从基线测量'。我会考虑简单地使用顶部填充 – njzk2
@ njzk2好的,这就是我要做的。我只是困惑,为什么它似乎没有工作,当我认为我正确地遵循设计指南。 –