iis服务器助手广告
返回顶部
首页 > 资讯 > 移动开发 >Android仿微信布局的实现示例
  • 875
分享到

Android仿微信布局的实现示例

2024-04-02 19:04:59 875人浏览 泡泡鱼
摘要

目前没有实现微信的功能,只是对微信的各个界面的调动以及对通讯录,发现和我中各个按钮的设置,同时如果你想尝试给微信中各个按钮背后添加功能时间可以用此作为模板哦,如拍照,朋友圈的添加都可

目前没有实现微信的功能,只是对微信的各个界面的调动以及对通讯录,发现和我中各个按钮的设置,同时如果你想尝试给微信中各个按钮背后添加功能时间可以用此作为模板哦,如拍照,朋友圈的添加都可以在此拓展哟,这个代码后期我会尽可能的添加对应的按钮的功能,希望对你们有所帮助,另外,这个代码的部分调用没有完成,不过我给部分的界面跳转做过例子了,照此方法即可完成,很容易的!另外我用的方法比较笨重,但是很容易理解,也算对我们初学者做个简单参考吧!

下面是代码部分:

<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity"
    android:background="@drawable/bj"
    android:orientation="vertical"
    >
 
    <TextView
        android:layout_marginTop="10dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="微信"
        android:gravity="center"
        android:textSize="25sp"
        android:textColor="#EDEEEA"
        />
    <Button
        android:layout_width="match_parent"
        android:layout_height="65dp"
        android:background="@drawable/sousuo"
 
        />
<LinearLayout
    android:layout_marginTop="550dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
    <Button
        android:id="@+id/wx"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
    android:background="@drawable/weixin"
        android:layout_weight="1"
    />
    <Button
        android:id="@+id/btn1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/tongxunlu"
        android:layout_weight="1"
        />
    <Button
        android:id="@+id/btn2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/faxian"
        android:layout_weight="1"
        />
    <Button
        android:id="@+id/btn3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/wo"
        android:layout_weight="1"
        />
 
</LinearLayout>
</LinearLayout>
package com.example.wechat1;
 
import androidx.appcompat.app.AppCompatActivity;
 
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
 
public class MainActivity extends AppCompatActivity {
private Button btn1,btn2,btn3;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        btn1=findViewById(R.id.btn1);
        btn2=findViewById(R.id.btn2);
        btn3=findViewById(R.id.btn3);
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(MainActivity.this,Main2Activity.class);
                startActivity(intent);
            }
        });
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(MainActivity.this,Main3Activity.class);
                startActivity(intent);
            }
        });
        btn3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(MainActivity.this,Main4Activity.class);
                startActivity(intent);
            }
        });
    }
}
<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Main2Activity"
    android:orientation="vertical"
    android:background="@drawable/bj"
    >
 
    <TextView
        android:textColor="#EDEEEA"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="通讯录"
        android:gravity="center"
        android:layout_marginTop="10dp"
        android:textSize="25sp"
        />
    <Button
        android:layout_width="match_parent"
        android:layout_height="65dp"
        android:background="@drawable/sousuo"
 
        />
    <Button
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:background="@drawable/xdpy"
        />
    <Button
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:background="@drawable/jlt"
        />
    <Button
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:background="@drawable/ql"
 
        />
    <Button
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:background="@drawable/bq"
        />
    <Button
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:background="@drawable/gzh"
        />
    <LinearLayout
        android:layout_marginTop="240dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <Button
            android:id="@+id/btn1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/weixin"
            android:layout_weight="1"
            />
        <Button
            android:id="@+id/txl"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/tongxunlu"
            android:layout_weight="1"
            />
        <Button
            android:id="@+id/btn2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/faxian"
            android:layout_weight="1"
            />
        <Button
            android:id="@+id/btn3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/wo"
            android:layout_weight="1"
            />
 
    </LinearLayout>
</LinearLayout>
package com.example.wechat1;
 
import androidx.appcompat.app.AppCompatActivity;
 
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
 
public class Main2Activity extends AppCompatActivity {
private Button btn1,btn2,btn3;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        btn1=findViewById(R.id.btn1);
        btn2=findViewById(R.id.btn2);
        btn3=findViewById(R.id.btn3);
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(Main2Activity.this,MainActivity.class);
                startActivity(intent);
            }
        });
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(Main2Activity.this,Main3Activity.class);
                startActivity(intent);
            }
        });
        btn3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(Main2Activity.this,Main4Activity.class);
                startActivity(intent);
            }
        });
    }
}
 
<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Main3Activity"
    android:orientation="vertical"
    android:background="@drawable/bj"
    >
<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="发现"
    android:gravity="center"
    android:textSize="25sp"
    android:layout_marginTop="10dp"
    android:textColor="#EDEEEA"
    />
    <Button
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:background="@drawable/pyq"
        />
    <Button
        android:layout_width="match_parent"
        android:layout_height="110dp"
        android:background="@drawable/sph"
        />
    <Button
        android:layout_width="match_parent"
        android:layout_height="110dp"
        android:background="@drawable/sys"
 
        />
    <Button
        android:layout_width="match_parent"
        android:layout_height="110dp"
        android:background="@drawable/kyk"
        />
    <Button
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:background="@drawable/fj"
        />
    <Button
        android:layout_width="match_parent"
        android:layout_height="110dp"
        android:background="@drawable/gw"
        />
    <Button
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:background="@drawable/xcx"
        />
    <LinearLayout
 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <Button
            android:id="@+id/wx"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/weixin"
            android:layout_weight="1"
            />
        <Button
            android:id="@+id/txl"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/tongxunlu"
            android:layout_weight="1"
            />
        <Button
            android:id="@+id/fx"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/faxian"
            android:layout_weight="1"
            />
        <Button
            android:id="@+id/w"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/wo"
            android:layout_weight="1"
            />
 
    </LinearLayout>
</LinearLayout>
<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Main4Activity"
    android:orientation="vertical"
    android:background="@drawable/bj"
    >
 
    <Button
        android:layout_marginTop="20dp"
        android:layout_width="wrap_content"
        android:layout_height="180dp"
        android:background="@drawable/w1"
        />
<Button
    android:layout_width="wrap_content"
    android:layout_height="60dp"
    android:background="@drawable/w2"
 
    />
    <Button
        android:layout_width="wrap_content"
        android:layout_height="60dp"
        android:background="@drawable/w3"
 
        />
    <Button
        android:layout_width="wrap_content"
        android:layout_height="60dp"
        android:background="@drawable/w4"
 
        />
    <Button
        android:layout_width="wrap_content"
        android:layout_height="60dp"
        android:background="@drawable/w5"
 
        />
    <Button
        android:layout_width="wrap_content"
        android:layout_height="60dp"
        android:background="@drawable/w6"
        />
    <Button
        android:layout_width="wrap_content"
        android:layout_height="60dp"
        android:background="@drawable/w7"
        />
    <Button
        android:layout_width="wrap_content"
        android:layout_height="60dp"
        android:background="@drawable/w8"
        />
 
 
</LinearLayout>

 到此这篇关于Android仿微信布局的实现示例的文章就介绍到这了,更多相关Android 微信布局内容请搜索编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持编程网!

--结束END--

本文标题: Android仿微信布局的实现示例

本文链接: https://www.lsjlt.com/news/144681.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Android仿微信布局的实现示例
    目前没有实现微信的功能,只是对微信的各个界面的调动以及对通讯录,发现和我中各个按钮的设置,同时如果你想尝试给微信中各个按钮背后添加功能时间可以用此作为模板哦,如拍照,朋友圈的添加都可...
    99+
    2024-04-02
  • android 仿微信demo——微信主界面实现
    目录主界面实现测试总结 以往文章中实现微信启动页,登录注册功能,此基础上继续完善仿微信功能。 主界面实现 (1)整体采用RelativeLayout相对布局 (2)最上面是too...
    99+
    2024-04-02
  • android 仿微信demo——微信启动界面实现
    目录微信启动界面创建项目微信启动界面实现测试总结微信启动界面 创建项目 android studio创建移动端项目 微信启动界面实现 当第一次点击微信时会看到微信出现启动界...
    99+
    2024-04-02
  • Flutter实现仿微信分享功能的示例代码
    目录1.首先去pub官网2 在微信开放平台注册开发者账号以及创建你的应用程序3 在分享页面3.1 初始化3.2 检测微信是否安装3.3 分享微信消息总结本文设计到的知识点有主要问题F...
    99+
    2024-04-02
  • Android ListView实现仿微信聊天界面
    本篇内容主要讲解“Android ListView实现仿微信聊天界面”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Android ListView实现仿微信聊天界面”吧!Android List...
    99+
    2023-06-20
  • Android实现微信登录的示例代码
    目录一、布局界面二、MainActivity.java微信登录的实现与qq登录类似。不过微信登录比较麻烦,需要拿到开发者资质认证,花300块钱,然后应用的话还得有官网之类的,就是比较...
    99+
    2024-04-02
  • uniapp模仿微信实现聊天界面的示例代码
    目录项目演示前言主界面chat.vue中引入的js文件chat.vue中引入的组件submit.vue中引入的组件最后项目演示 前言 我是看B站的视频一个一个敲的,讲的还不错。可以...
    99+
    2024-04-02
  • android 仿微信demo——微信消息界面实现(移动端)
    目录移动端微信消息页实现总结移动端微信消息页实现 在上一篇中主界面实现说过微信四个页面中间都是是fragment的,并且四个fragment的布局都还没实现,所以这一篇主要实现微信...
    99+
    2024-04-02
  • android 仿微信demo——微信消息界面实现(服务端)
    目录服务端微信消息页实现测试总结 上一篇实现了移动端微信消息界面功能,以此为基础继续完善服务端功能 服务端微信消息页实现 微信消息界面的实现,和登录,注册是类似的,无非就是接受客...
    99+
    2024-04-02
  • Android如何实现仿微信@好友功能
    这篇文章主要介绍Android如何实现仿微信@好友功能,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!先上个效果图就是这么个功能1. 分析需求输入@跳转到联系人界面,选中一个或者多个好友返回到当前界面按退格键删除整块内...
    99+
    2023-05-30
    android
  • Android如何实现仿微信数字键盘
    这篇文章主要介绍了Android如何实现仿微信数字键盘,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。一、图示效果二、需要考虑的问题布局的实现方式;demo中使用了popupw...
    99+
    2023-06-15
  • Android使用ViewStub实现布局优化方法示例
    目录实践过程实现方式知识点实践过程 Hello,大家好啊,我是小空,今天带大家了解下动态加载控件ViewStub。 在平时开发中经常会遇到复杂布局,而每一个view都是会占据内存和消...
    99+
    2024-04-02
  • Android仿微信输入框效果的实现代码
    仿微信输入框效果图:输入框:<EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:layout...
    99+
    2023-05-31
    android 输入框
  • Android仿淘宝切换商品列表布局效果的示例代码
    最近电商项目中有这样一个需求,就是在进入商品列表界面,有一个按钮可以切换商品列表的布局(网格或者垂直列表排列)。效果图:上面两幅图分别是点击右上角按钮后显示两种不同布局的效果。简单的流程可以概括为:第一次进入页面,有个默认的布局(网格布局)...
    99+
    2023-05-30
    android 商品列表 roi
  • android如何实现仿微信通讯录搜索
    这篇文章将为大家详细讲解有关android如何实现仿微信通讯录搜索,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。一:先看效果图字母索引搜索匹配二:功能分析1:汉字转拼音通讯录汉字转拼音(首个字符当考虑姓氏...
    99+
    2023-05-30
    android
  • Flutter实现仿微信分享功能的示例代码怎么写
    这期内容当中小编将会给大家带来有关Flutter实现仿微信分享功能的示例代码怎么写,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。Flutter 用来快速开发 Android iOS平台应用,在Flutte...
    99+
    2023-06-26
  • Android仿微信雷达扫描效果的实现方法
    本文主要给大家介绍的是关于Android实现微信雷达扫描效果的相关内容,分享出来供大家参考学习,下面来看看详细的介绍:废话不多说 先上图(用AS录制的 转换工具不是很好 所以看得效果不是很好)效果图示例代码Activity 代码public...
    99+
    2023-05-31
    android 雷达扫描
  • android 仿微信demo——注册功能实现(移动端)
    目录移动端注册功能实现测试总结移动端注册功能实现 微信的注册界面每一个文本段都有下划线且默认颜色都是灰色,当其中一个文本段获取焦点会将下划线的颜色变为绿色,而且文本输入框的光标也是绿...
    99+
    2024-04-02
  • android 仿微信demo——注册功能实现(服务端)
    目录服务端注册功能实现创建项目创建web层和客户端完成数据交互创建service层处理业务逻辑功能创建dao层操作数据库通过JDBC工具类访问数据库mysql中创建数据库和表测试总结...
    99+
    2024-04-02
  • android 仿微信demo——登录功能实现(服务端)
    目录服务端登录功能实现测试总结 上一篇文章实现了微信登录的移动端功能,下面继续完善功能,实现微信登录服务端功能 服务端登录功能实现 在以往文章里已经实现了服务端mvc框架,而登录和...
    99+
    2024-04-02
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作