android:fontFamily在android Studio中无法识别
我试图在MacOSX上使用Android Studio在Android开发者网站上实现对话教程。除了提示的字体外,一切都很好。以下是设计视图中的图片: 由于出现以下错误,我无法在设备上运行它:android:fontFamily在android Studio中无法识别,android,dialog,Android,Dialog,我试图在MacOSX上使用Android Studio在Android开发者网站上实现对话教程。除了提示的字体外,一切都很好。以下是设计视图中的图片: 由于出现以下错误,我无法在设备上运行它: Gradle: No resource identifier found for attribute 'fontFamily' in package 'android' 以下是与开发人员网站上相同的xml代码 <TextView android:layout_height="match_p
Gradle: No resource identifier found for attribute 'fontFamily' in package 'android'
以下是与开发人员网站上相同的xml代码
<TextView
android:layout_height="match_parent"
android:layout_width="match_parent"
android:text="ID"
android:textSize="8pt"
android:textColor="#000000"
/>
<EditText
android:id="@+id/username"
android:inputType="text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="4dp"
android:hint="enter your username"
/>
<TextView
android:layout_height="match_parent"
android:layout_width="match_parent"
android:text="PIN"
android:textSize="8pt"
android:textColor="#000000"/>
<EditText
android:id="@+id/password"
android:inputType="textPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="16dp"
android:fontFamily="sans-serif"
android:hint="enter your password" />
在Android中,您应该使用Android:typeface=serif
Android本身只有3种默认字体:
普通机器人
衬线机器人衬线
单空间机器人
谢谢..但是以上三个都不会改变提示的字体。它与图中的相同question@stud91很抱歉,您不能更改提示的字体面,只能更改内容值的字体面。好的。在这里的文档中,它说您应该将其字体系列更改为无衬线字体,以便两个文本字段使用匹配的字体样式。所以我们无法使字体一致?