
现在添加动画来像这样翻转卡片.
final AnimatorSet setRightOut = (AnimatorSet) AnimatorInflater.loadAnimator(mActivity,R.animator.flip_right_out);final AnimatorSet setleftIn = (AnimatorSet) AnimatorInflater.loadAnimator(mActivity,R.animator.flip_left_in);setRightOut.setTarget(swipeview);setleftIn.setTarget(backVIEw);setRightOut.start();setleftIn.start();
swipeview是Swift的CardVIEw.而backVIEw是CardVIEw,它应该通过翻转动画替换swipeview.
当我使用swipeview两次时,一切正常.所以它翻转360度回到自身.但我似乎无法显示任何其他内容.
如何正确实现backVIEw?在我的布局XML下面.
<?xml version="1.0" enCoding="utf-8"?><relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content"> <androID.support.v7.Widget.CardVIEw xmlns:androID="http://schemas.androID.com/apk/res/androID" xmlns:card_vIEw="http://schemas.androID.com/apk/res-auto" androID:ID="@+ID/card_front" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:descendantFocusability="blocksDescendants" card_vIEw:cardElevation="@dimen/card_elevation"> <linearLayout ....</linearLayout> </androID.support.v7.Widget.CardVIEw> <androID.support.v7.Widget.CardVIEw xmlns:androID="http://schemas.androID.com/apk/res/androID" xmlns:card_vIEw="http://schemas.androID.com/apk/res-auto" androID:ID="@+ID/card_back" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:descendantFocusability="blocksDescendants" card_vIEw:cardElevation="@dimen/card_elevation"> <linearLayout ....</linearLayout> </androID.support.v7.Widget.CardVIEw></relativeLayout>
通过一些进一步的调查,它看起来像是视图,但Alpha = 0.这里有一些来自日志的信息,然后才触发翻转动画:
RecyclerFragment:VIEwHolder {418f3088 position = 1 ID = -1,oldPos = -1,pLpos:-1}
RecyclerFragment:getBackCard:androID.Widget.relativeLayout {418f1ab8 V.E ….. ……我. 0,0-0,0}
RecyclerFragment:swipeview:androID.Widget.relativeLayout {418eda10 V.E … C. …….. 0,-13-480,638}
RecyclerFragment:LP:androID.Widget.relativeLayout$LayoutParams@418dc2b8
RecyclerFragment:backVIEw:androID.Widget.relativeLayout {418f1ab8 V.E ….. ……我. 0,0}
当我在翻转动画后触摸swipVIEw时,我可以将其拖动并显示原始的CardVIEw旋转180度.我可以再次翻转,但仍然没有显示任何内容.但是没有触摸就不会显示任何内容.欢迎任何想法!
解决方法 问题是swipeview是relativeLayout而backVIEw是CardVIEw.添加; final查看frontVIEw = swipeview.findVIEwByID(R.ID.front_card); 总结以上是内存溢出为你收集整理的Android RecyclerView与翻转CardView全部内容,希望文章能够帮你解决Android RecyclerView与翻转CardView所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)