Android使用共享元素实现转场动画 错误:Unable to create layer for LinearLayout
来源:互联网 发布:linux关闭nagle算法 编辑:程序博客网 时间:2024/05/17 22:26
最近重构app商品模块,各种app借鉴,发现共享元素的效果挺不错,准备加上。
网上找资料,效果挺不错。然后就开始埋头重构。
先说一下商品界面的布局
使用SlideDetailsLayout 来实现界面上不的详情页和下部的webview图文说明页(产品说的照着京东来。。。)
<com.zhtx.cs.customview.SlideDetailsLayout android:id="@+id/sv_switch" android:layout_width="match_parent" android:layout_height="match_parent"> <com.zhtx.cs.customview.MyScrollView android:id="@+id/sv_goods_info" android:layout_width="match_parent" android:layout_height="wrap_content" android:scrollbars="none"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/c_eeeeee" android:orientation="vertical" > // 要共享的view在这里 ... <LinearLayout android:id="@+id/ll_goods_detail_tuijian" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="@color/white_true" android:layout_marginTop="@dimen/x9" android:visibility="visible"> <View style="@style/line" /> <com.bigkoo.convenientbanner.ConvenientBanner android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ffffff" app:canLoop="true" android:layout_marginLeft="15dp" android:layout_marginRight="15dp" android:layout_marginTop="15dp" android:visibility="visible"/> </LinearLayout> ... </LinearLayout> </com.zhtx.cs.customview.MyScrollView> <include layout="@layout/include_item_tab" /> </com.zhtx.cs.customview.SlideDetailsLayout>
ScrollView里边各种乱七八糟的信息,我留下了ConvenientBanner,问题就出现在这里。
在使用转场动画的时候,在小米4手机上华丽丽的卡死了
报的错误是这样的
JNI DETECTED ERROR IN APPLICATION: JNI CallObjectMethod called with pending exception java.lang.IllegalStateException: Unable to create layer for LinearLayout'
说是不可以创建ConvenientBanner这个布局
然后网上各种找资料,网上说在共享元素实现转场动画,Transition group 设置为true,让我们可以将ViewGroup
作为一个整体来变换
最后的解决方案是,在最外边的ScrollView加上这一句话
android:transitionGroup="true"
具体的原因大家有兴趣的可以看看 http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/0116/2320.html
阅读全文
0 0
- Android使用共享元素实现转场动画 错误:Unable to create layer for LinearLayout
- Android5.0使用共享元素实现转场动画
- Android共享元素转场动画Part2——Fragment to Fragment
- android转场动画&共享元素&另外一种动画Transition
- ScrollView嵌套WebView报Unable to create layer for WebView
- 在Fragment如何使用共享元素转场动画
- Android 使用ActivityOptions实现Activity转场动画
- 共享元素转场动画Part1————Activity to Activity
- java.lang.SecurityException:Unable to create application Unable to find app for caller android.app
- Android 动画-共享元素动画
- Unable to create converter for class`
- binbinyang--Unable to create converter for class
- 你不知道的Android 5.0转场共享动画实现炫酷效果
- Relay 客户端 rose命令行启动错误 "unable to create shared memory for shutdown channel"
- Android Transition FrameWork实现转场动画
- Android 5.0 转场动画的使用
- 实现Activity间的共享控件转场动画
- iOS layer层的转场动画
- 跳转语句,如果是pc访问就127.0.0.1
- 【Audio】耳机错误/频繁插入造成的无法识别
- 博客园 首页 新随笔 联系 订阅 管理 Ubuntu 16.04搭建LAMP开发环境 1. 配置网络环境 略 2. 设置ROOT密码 sud
- echarts2-网络动态攻击(带涟漪效果)
- 经验分享 | 【PDF下载】大数据峰会之MaxCompute数据上云与生态
- Android使用共享元素实现转场动画 错误:Unable to create layer for LinearLayout
- [转] 如何把书上的字弄到电脑上
- 在编译期,获得函数参数个数
- YARN ResourceManager调度器的分析
- 网络广告投放基础,广告
- JSP的内置对象
- RHEL linux7.3 安装Apache服务
- Oracle快速入门(2)——Oracle安装教程
- CSS学习总结