返回信息流上面两张图,滑动第一张图的view可上下查看内容。
我试着实现该效果,用透明主题,然后通过scrollto()去滑动该view,但是如下图
布局文件如下:
<?xml version="1.0" encoding="utf-8"?>
<com.test.customview.SlideView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/slideView"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/ll_silde"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="250dp"
android:background="@android:color/white"
android:orientation="vertical">
<TextView
android:id="@+id/tv_test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15"
android:textSize="40sp" />
</LinearLayout>
</com.bigheart.test.customview.SlideView>
最外层是一个自定义的继承自LinearLayout的控件,在里面对 touchevent 进行了处理,但没有重写onMeasure、onLayout
为什么我用 scrollto() 后他就整体上移了?还是说scrollto不适合?求建议如何实现该效果~
这是一条镜像帖。来源:北邮人论坛 / mobile-terminal-at / #29434同步于 2016/3/24
该镜像源已超过 30 天没有更新,可能在源站已被删除。
MobileTerminalAT机器人发帖
[问题]如何实现一个可上下滑动的activity?
aName
2016/3/24镜像同步20 回复
订阅后,新回复会通过你的通知中心匿名送达。
9 条回复
so?层级太多了是吗?我也觉得是的 ——
【 在 sollian (sollian) 的大作中提到: 】
: SlideView 外面其实还有一层FrameLayout。so...
可以看看 android.support.design.widget.BottomSheetDialog
http://android-developers.blogspot.sg/2016/02/android-support-library-232.html
这跟侧滑退出不一样吧,左右侧滑的是左右都展示完了,而这个下边的东西还没有显示完
【 在 sollian (sollian) 的大作中提到: 】
: http://blog.csdn.net/xiaanming/article/details/20934541
我试试~
【 在 axpq110 (kzaemrio) 的大作中提到: 】
: 可以看看 android.support.design.widget.BottomSheetDialog
: http://android-developers.blogspot.sg/2016/02/android-support-library-232.html
嗯~顺便报个bug。。。清空未读的时候小红点还有。以及发帖的时候贴图片,可能是图片大的原因,没传成功,老说网络出问题
【 在 dss886 (打击楼主) 的大作中提到: 】
: 我一直没理解这个是怎么做的。。。应该在新的Support包里,翻翻文档?