AS第一次作业——构建类安卓微信界面

使用AS构建类安卓微信界面

本次实验分为2步:(一)设置UI界面;(二)编写java程序

(一)在xml中编程,使微信的UI界面能完美显示
1.首先去除安卓在左上角显示的软件标题,使用下面的代码

requestWindowFeature(Window.FEATURE_NO_TITLE);

去除后的效果图为
在这里插入图片描述

2.设计UI界面时需要设计头部,底部,以及4个按键对应的界面内容
我们将这4个界面用layout形式实现,名字分别取为top,bottom,tab01~04.

3.top的xml文件内容如下

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:gravity="center"
    android:background="#000000"
    android:orientation="vertical">

    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:text="@string/app_name"
        android:textColor="#ffffff"
        android:textSize="20sp" />
</LinearLayout>

4.bottom的xml文件内容中需要设置4个按钮的图标和中文

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:background="@drawable/bottom_ba
  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值