我的位置: 首页 >> App >> App知识

Android 开发简介(android电筒例子)

<TextView

    android:layout_width="fill_parent"

    android:layout_height="wrap_content"

    android:text="@string/hello" android:textColor="@color/all_black"

   android:gravity="center_horizontal"/>

</LinearLayout>

复制代码

在 strings.xml 中创建两个颜色资源。

清单 2. strings.xml 中的颜色

<?xml version="1.0" encoding="utf-8"?>

<resources>

    <string name="hello">Android FlashLight</string>

    <string name="app_name">FlashLight</string>

    <color name="all_white">#FFFFFF</color>

    <color name="all_black">#000000</color>

</resources>

复制代码

     主屏幕布局有一个定义为 all_white 的背景色。在 strings.xml 文件中,可以看到 all_white 被定义为一个值为 #FFFFFF 的 RGB 三元组,即纯白。

翻页: 1 2 3 4 5 6 7 8 9 10 11

App知识

客户中心

版权2005-2020    聚卓网络有限公司    电话:18589057325    QQ:2338754269   粤ICP备14021702号

地址:深圳市宝安区 37区龙井一路100号 新乐社区工作站办公大楼侧门6楼(近翻身路、新乐社区健康服务中心)

技术支持: 网站建设