SlidingMenu侧滑菜单的布局,点击头像滑出菜单

实现效果:点击头像或者从屏幕左边滑出侧滑菜单

导入依赖,

[html] view plain copy
  1. compile 'com.facebook.fresco:fresco:0.14.1'  
  2. compile 'com.jakewharton:butterknife:8.8.1'  
  3. annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'  
添加权限,(头像是请求网络的)
[html] view plain copy
  1. <uses-permission android:name="android.permission.INTERNET"/>  
新建MyApplication,在清单文件中声明
[html] view plain copy
  1. public class MyApplication extends Application {  
  2.     @Override  
  3.     public void onCreate() {  
  4.         super.onCreate();  
  5.         //初始化Fresco  
  6.   
  7.         Fresco.initialize(this);  
  8.     }  
  9. }  
[html] view plain copy
  1. <application  
  2.         android:name=".applica.MyApplication"  

用到的图片

sliding_touxiang     female            edit           messages       my_takecare     my_collection

                                       

search_friend       sliding_xiangyoua   directory         settings            night_colse

先放上侧滑菜单的布局 sliding_left.xml

[html] view plain copy
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     xmlns:fresco="http://schemas.android.com/apk/res-auto"  
  4.     android:orientation="vertical"  
  5.     android:background="#fff"  
  6.     android:layout_width="match_parent"  
  7.     android:layout_height="match_parent">  
  8.   
  9.     <LinearLayout  
  10.         android:orientation="vertical"  
  11.         android:background="#d2a0df"  
  12.         android:layout_width="matc
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值