Android Studio搭建简单类微信小程序首页框架

目录

1、页面布局

2、代码具体实现

3、界面展示


1、页面布局

第一步:创建top.xml和bottom.xml.文件,用于设计界面顶部与底部按键。再修改activity_main.xml文件,将前面两个文件效果加入。最后设计四个功能界面。

1、 top.xml

用于首页标题显示

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="#4CAF50">

    <TextView
        android:id="@+id/textView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:text="我的微信"
        android:textColor="@color/black"
        android:textSize="30sp" />
</LinearLayout>

bottom.xml

四个linearlayout(线性布局)中均包含一个textview和一个imageview。

<LinearLayout
        android:id="@+id/tab01"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:gravity="center"
        android:orientation="vertical">

        <ImageView
            android:id="@+id/weixinButton"
            android:layout_width="match_parent"
            android:layout_height="49dp"
            app:srcCompat="@drawable/message" />

        <TextView
            android:id="@+id/weixinText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="微信"
            android:textColor="@color/black"
            android:textSize="20sp" />
    </LinearLayout>

  • 9
    点赞
  • 88
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值