手机信息页面1.

设计思路

1.将准备好的把个图标复制到res/drawable文件下
2.创建一个表格布局,并在表格布局里创建网格布局
3.在网格布局中添加相应的TextView
4.在values文件下的style.xml文件中存放抽取出来的样式
5.创建values-zh-rCN、values-en-rUS文件夹,并在文件夹中创建string.xml文件

1.tablelayout.xml

<?xml version="1.0"encoding="utf-8"?>
<TableLayoutxmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/darker_gray"
>

    <GridLayout
        style="@style/h_wrap_content"
        android:layout_marginBottom="10dp"
        android:layout_marginTop="10dp"
        android:columnCount="2"
>

        <TextView
            style="style/hht_style"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_column="0"
            android:layout_columnWeight="1"
            android:layout_marginLeft="10dp"
            android:layout_rowWeight="1"
            android:drawableTop="@drawable/clound"
            android:text="string/_clound"

            
/>

        <TextView
            style="style/hht_style"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_column="1"
            android:layout_columnWeight="1"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_rowWeight="1"
            android:drawableTop="@drawable/bluetooth"
            android:text="string/_bluetooth"

            
/>

        <TextView
            style="style/hht_style"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_columnWeight="1"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="10dp"
            android:layout_rowWeight="1"
            android:drawableTop="@drawable/gesture"
            android:text="string/_gesture"

            
/>

        <TextView
            style="style/hht_style"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_column="1"
            android:layout_columnWeight="1"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:layout_rowWeight="1"
            android:drawableTop="@drawable/gps"
            android:text="string/_gps"

            
/>

        <TextView
            style="style/hht_style"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_column="0"
            android:layout_columnWeight="1"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="10dp"
            android:layout_rowWeight="1"
            android:drawableTop="@drawable/info"
            android:text="string/_system_info"

            
/>

        <TextView
            style="style/hht_style"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_column="1"
            android:layout_columnWeight="1"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:layout_rowWeight="1"
            android:drawableTop="@drawable/internet"
            android:text="string/_internet"

            
/>

        <TextView
            style="style/hht_style"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_column="0"
            android:layout_columnWeight="1"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="10dp"
            android:layout_rowWeight="1"
            android:drawableTop="@drawable/language"
            android:text="string/_system_language"

            
/>

        <TextView
            style="style/hht_style"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_column="1"
            android:layout_columnWeight="1"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:layout_rowWeight="1"
            android:drawableTop="@drawable/notifycation"
            android:text="string/_set_notifycation"

            
/>
    </GridLayout>

</TableLayout>

2.style.xml

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

    <string name="AppBaseTheam"parent="android:Theme.Light"></string>

    <string name="AppTheme."parent="AppBaseTheam"></string>

    <style name="h_wrap_content">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">match_parent</item>
    </style>

    <style name="hht_style">
        <item name="android:layout_width">145dp</item>
        <item name="android:layout_height">90dp</item>
        <item name="android:gravity">center</item>
        <item name="android:paddingTop">8dp</item>
        <item name="android:paddingBottom">8dp</item>
        <item name="android:drawablePadding">5dp</item>
        <item name="android:background">@android:color/white</item>
    </style>

3.values-en-rUS

</resources>

<resources>
    <stringname="app_name">PhoneInfo</string>
    <stringname="menu_setting">Setting</string>
    <stringname="hello_world">Hello_world</string>
    <stringname="_clound">Clound</string>
    <stringname="_bluetooth">Bluetooth</string>
    <stringname="_gesture">Gesture</string>
    <stringname="_gps">GPS</string>
    <stringname="_system_info">SystemInfo</string>
    <stringname="_internet">Internet</string>
    <stringname="_language">Language</string>
    <stringname="_set_notifycation">Notifycation</string>
</resources>

4.values-zh-rCN

<resources>
    <stringname="app_name">手机信息页面</string>
    <stringname="menu_setting">设置</string>
    <stringname="hello_world">你好,世界</string>
    <stringname="_clound">云通信</string>
    <stringname="_bluetooth">蓝牙</string>
    <stringname="_gesture">自定义手势</string>
    <stringname="_gps">定位</string>
    <stringname="_system_info">系统信息</string>
    <stringname="_internet">网络</string>
    <stringname="_language">语言</string>
    <stringname="_set_notifycation">通知栏设置</string>
</resources>

 5.效果图

              通过这次实验我知道了学什么理论都得实践,实践是检验真理的唯一标准。通过向同学询问和同学探讨最终才得到最终效果。虽然过程很艰难但是是痛并快乐着,期待下一次的实验和考验。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值