总结 2017.12.18

手机微信通讯录右侧字母的实现:


新创建一个布局用来编辑我们所需要的字母部分,主要是应用相对布局里控件的排序的掌握,具体代码如下

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            >

            <RelativeLayout
                android:layout_alignParentRight="true"
                android:layout_width="10dp"
                android:layout_height="match_parent">

                <TextView
                    android:id="@+id/A"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textSize="14sp"
                    android:text="\n\n\n↑A"></TextView>


	     </RelativeLayout>

        </RelativeLayout>

    </ScrollView>

 </RelativeLayout>

代码只举例出字母A的编辑方法,其余字母代码同理



其次在我们事先画好的通讯录布局,应用include 来引用我们的字母部分,即可实现向下滑动时,字母也跟随的滑动

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值