Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 按钮和文本视图的字体厚度不同_Android_Xml_Android Studio_Android Layout - Fatal编程技术网

Android 按钮和文本视图的字体厚度不同

Android 按钮和文本视图的字体厚度不同,android,xml,android-studio,android-layout,Android,Xml,Android Studio,Android Layout,我试图在文本视图和按钮之间创建相同的字体样式,但是按钮看起来有点厚,即使是相同的样式。我尝试为两者设置textStyle=“normal”,但它们仍然不同 <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="text1" android:textSty

我试图在文本视图和按钮之间创建相同的字体样式,但是按钮看起来有点厚,即使是相同的样式。我尝试为两者设置textStyle=“normal”,但它们仍然不同

<TextView
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:text="text1"
     android:textStyle="normal"
     android:textColor="#ffffff"
     android:textSize="16dp"/>

<Button
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:text="text2"
     android:textAllCaps="false"
     android:textColor="#ffffff"
     android:textStyle="normal"
     android:textSize="16dp"/>

在任何情况下,对于
textSize
使用
sp
而不是
dp