用Android Studio创建一个名为“手机信息页面”的程序,该程序用于展示手机设置页面的信息。
1.运行效果图
2. 设计思路(实现原理)
1)将准备好的八个图标复制到res/drawable文件夹下
2)创建一个垂直的线性布局,并在线性布局中创建4个相对布局
3)在相对布局中添加相应的TextView
4)在values文件下的style.xml文件中存放抽取出来的样式
5)创建values-zh-rCN、values-en-rUS文件夹,并在文件夹中创建strings.xml文件
3.案例实现
1)创建手机信息页面程序
在res/layout文件夹下的activity_main.xml为程序界面对应布局文件,其中的代码如下所示:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout 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:background="@android:color/darker_gray" android:orientation="vertical" tools:context="bzu.edu.cn.phoneinfo.MainActivity"> <RelativeLayout style="@style/h_wrap_content" android:layout_marginTop="10dp"> <TextView style="@style/tv_style" android:layout_alignParentLeft="true" android:layout_marginLeft="10dp" android:drawableTop="@drawable/clound" android:text="@string/_cloud"/> <TextView style="@style/tv_style" android:layout_alignParentRi

本文介绍如何使用Android Studio创建一个名为'手机信息页面'的程序,展示手机设置信息。程序包括设计思路和具体实现步骤,涉及布局设计、样式抽取、多语言支持以及MainActivity中的逻辑代码编写。通过设置不同语言的strings.xml文件,实现英文和中文的切换。
最低0.47元/天 解锁文章
561

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



