ITPub博客

首页 > 应用开发 > Java > 直播app源码,标题栏随页面滑动之title移动定位效果

直播app源码,标题栏随页面滑动之title移动定位效果

原创 Java 作者:zhibo系统开发 时间:2021-11-22 14:09:12 0 删除 编辑

直播app源码,标题栏随页面滑动之title移动定位效果实现的相关代码

布局代码:


<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="
    android:layout_width="match_parent"
    android:layout_height="match_parent">
 
    <!--内容视图部分-->
    <com.titleanim.kevin.MyScrollView
        android:id="@+id/scrollView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
 
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
 
            <ImageView
                android:layout_width="match_parent"
                android:layout_height="210dp"
                android:scaleType="fitXY"
                android:src="@drawable/k_astronauts" />
 
            <View
                android:id="@+id/v_left"
                android:layout_width="30dp"
                android:layout_height="15dp"
                android:background="@color/colorAccent" />
 
            <TextView
                android:id="@+id/tv_titleBottom"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="我是标题"
                android:textColor="@color/colorAccent"
                android:textSize="16sp" />
 
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="20dp"
                android:lineSpacingExtra="15dp"
                android:text="航天英雄杨利伟。。。"
                android:textColor="#666666"
                android:textSize="14sp" />
 
        </LinearLayout>
    </com.titleanim.kevin.MyScrollView>
 
    <!--标题部分-->
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="70dp">
 
        <View
            android:id="@+id/v_titleBg"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:alpha="0"
            android:background="@android:color/white" />
 
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="45dp"
            android:layout_alignParentBottom="true">
 
            <ImageView
                android:id="@+id/iv_back"
                android:layout_width="45dp"
                android:layout_height="match_parent"
                android:contentDescription="@null"
                android:scaleType="centerInside"
                android:src="@drawable/selector_back" />
 
            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_centerHorizontal="true"
                android:gravity="center_horizontal"
                android:orientation="horizontal">
 
                <View
                    android:id="@+id/v_leftTop"
                    android:layout_width="30dp"
                    android:layout_height="15dp"
                    android:layout_marginTop="45dp"
                    android:background="@color/colorAccent" />
 
                <TextView
                    android:id="@+id/tv_titleTop"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="45dp"
                    android:paddingLeft="5dp"
                    android:text="我是标题"
                    android:textColor="@color/colorAccent"
                    android:textSize="16sp" />
            </LinearLayout>
        </RelativeLayout>
    </RelativeLayout>
</RelativeLayout>


以上就是直播app源码,标题栏随页面滑动之title移动定位效果实现的相关代码, 更多内容欢迎关注之后的文章


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/69978258/viewspace-2843410/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2020-07-02

  • 博文量
    674
  • 访问量
    255206