Android Studio
在activit_main.xml文件里添加:
android:background="#00BFFF""
#00BFFF"可以替换成其它颜色。
整个activit_main.xml代码如下:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"
android:background="#00BFFF">
<TextView
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:text="你是猴子派来的救兵吗?"
android:textSize="40px"/>
</RelativeLayout>
在真实android设备上运行结果如下:
RGB颜色查询对照表:点击打开链接
本文将指导您如何在AndroidStudio的activit_main.xml文件中设置背景颜色,并展示实际运行效果及RGB颜色查询对照表。
1100

被折叠的 条评论
为什么被折叠?



