尝试在以下链接https://dribbble.com/shots/1753718-Chat-Screen-UX-UI-iOS-App中实现动画。附上我们迄今为止尝试过的内容。无法准确再现动画。分享您对如何实施它的想法。
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder;
View view = convertView;
if (view == null) {
viewHolder = new ViewHolder();
view = mInflater.inflate(R.layout.rowlayout, null);
viewHolder.textView = (TextView) view.findViewById(R.id.textView);
view.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) view.getTag();
}
viewHolder.textView.setText(mItems.get(position));
animate(view, position);
return view;
}
private void animate(View target, int index){
Animation animtopOut = AnimationUtils.loadAnimation(mContext, R.anim.slide_top_to_bottom);
animtopOut.setStartOffset(index * 100);
target.startAnimation(animtopOut);
}
附加动画资源文件
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator">
<translate android:fromYDelta="-100%" android:toYDelta="0"
android:duration="100" />
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
android:duration="500" />
</set>
答案 0 :(得分:0)
在我看来:
UX演示似乎每个项目应该从-90到0旋转x轴以显示,你可以使用ViewPropertyAnimator.rotationX(浮点值)或ViewPropertyAnimator.rotationXBy(浮点值)来改变为视图的旋转x,记住首先将轴y设置为0,以便动画可以从视图顶部旋转