直播app源码,标题栏随页面滑动之title移动定位效果
直播app源码,标题栏随页面滑动之title移动定位效果实现的相关代码
布局代码:
1 | <?xml version= "1.0" encoding= "utf-8" ?><br><RelativeLayout xmlns:android= "http://schemas.android.com/apk/res/android" <br> android:layout_width= "match_parent" <br> android:layout_height= "match_parent" ><br> <br> <!--内容视图部分--><br> <com.titleanim.kevin.MyScrollView<br> android:id= "@+id/scrollView" <br> android:layout_width= "match_parent" <br> android:layout_height= "wrap_content" ><br> <br> <LinearLayout<br> android:layout_width= "match_parent" <br> android:layout_height= "wrap_content" <br> android:orientation= "vertical" ><br> <br> <ImageView<br> android:layout_width= "match_parent" <br> android:layout_height= "210dp" <br> android:scaleType= "fitXY" <br> android:src= "@drawable/k_astronauts" /><br> <br> <View<br> android:id= "@+id/v_left" <br> android:layout_width= "30dp" <br> android:layout_height= "15dp" <br> android:background= "@color/colorAccent" /><br> <br> <TextView<br> android:id= "@+id/tv_titleBottom" <br> android:layout_width= "wrap_content" <br> android:layout_height= "wrap_content" <br> android:text= "我是标题" <br> android:textColor= "@color/colorAccent" <br> android:textSize= "16sp" /><br> <br> <TextView<br> android:layout_width= "match_parent" <br> android:layout_height= "wrap_content" <br> android:layout_marginTop= "20dp" <br> android:lineSpacingExtra= "15dp" <br> android:text= "航天英雄杨利伟。。。" <br> android:textColor= "#666666" <br> android:textSize= "14sp" /><br> <br> </LinearLayout><br> </com.titleanim.kevin.MyScrollView><br> <br> <!--标题部分--><br> <RelativeLayout<br> android:layout_width= "match_parent" <br> android:layout_height= "70dp" ><br> <br> <View<br> android:id= "@+id/v_titleBg" <br> android:layout_width= "match_parent" <br> android:layout_height= "match_parent" <br> android:alpha= "0" <br> android:background= "@android:color/white" /><br> <br> <RelativeLayout<br> android:layout_width= "match_parent" <br> android:layout_height= "45dp" <br> android:layout_alignParentBottom= "true" ><br> <br> <ImageView<br> android:id= "@+id/iv_back" <br> android:layout_width= "45dp" <br> android:layout_height= "match_parent" <br> android:contentDescription= "@null" <br> android:scaleType= "centerInside" <br> android:src= "@drawable/selector_back" /><br> <br> <LinearLayout<br> android:layout_width= "wrap_content" <br> android:layout_height= "match_parent" <br> android:layout_centerHorizontal= "true" <br> android:gravity= "center_horizontal" <br> android:orientation= "horizontal" ><br> <br> <View<br> android:id= "@+id/v_leftTop" <br> android:layout_width= "30dp" <br> android:layout_height= "15dp" <br> android:layout_marginTop= "45dp" <br> android:background= "@color/colorAccent" /><br> <br> <TextView<br> android:id= "@+id/tv_titleTop" <br> android:layout_width= "wrap_content" <br> android:layout_height= "wrap_content" <br> android:layout_marginTop= "45dp" <br> android:paddingLeft= "5dp" <br> android:text= "我是标题" <br> android:textColor= "@color/colorAccent" <br> android:textSize= "16sp" /><br> </LinearLayout><br> </RelativeLayout><br> </RelativeLayout><br></RelativeLayout> |
以上就是直播app源码,标题栏随页面滑动之title移动定位效果实现的相关代码, 更多内容欢迎关注之后的文章
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现