如何在Android Studio中切换显示的UI并更改字体颜色?

6
我使用Android Studio编写我的应用程序,以下代码是我的布局文件,但有时Android Studio编辑器显示A.png,有时显示B.png。这意味着有时系统将android:text="@string/myabout"替换为实际字符串"About",但我不知道如何切换到UI。
此外,我该如何更改android:text="@string/myabout"android:text="Hard Code"的代码颜色?您知道,文件->设置->编辑器是一个庞大的树形结构,我找不到需要编辑的项目。
<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout  xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/border_ui"
    android:orientation="vertical" >

     <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/myabout"
      />

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hard Code"
     />

</RelativeLayout>

A.png

enter image description here

B.png enter image description here


还有什么其他的想法吗? - HelloCW
1个回答

0

设置 -> 编辑器 -> 颜色和字体 -> XML -> 属性值。然后你可以将其设置为粗体斜体前景色背景色等等。

但是为什么要这样做呢?这有关系吗?


谢谢!我的意思是我希望在Android Studio编辑器中更改颜色。你知道,在Android Studio中,文件->设置->编辑器是一个庞大的树形结构,我找不到应该编辑哪些项目。 - HelloCW
谢谢!但是我找不到如何在设置->编辑器->颜色和字体->XML->属性值中将文本属性值为硬编码时的颜色设置为属性值的颜色。 - HelloCW

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接