我正在将布局动画设置为列表视图(我的项目正在下降)。在列表视图中,我有一个标题,我不想动画。
如何在标题上抑制动画?
答案 0 :(得分:0)
如果它始终是静态视图,您是否考虑使用单独的视图而不是标题列表视图的一部分?
答案 1 :(得分:0)
我在Google Group讨论的帮助下成功解决了这个问题。 https://groups.google.com/forum/?fromgroups#!topic/android-developers/F7_zE_k9KO8
我最终创建了一个自定义视图,并重写了getAnimation(),返回null。
public class HeaderSearchNoAnimationVIew extends LinearLayout {
public HeaderSearchNoAnimationVIew(Context context) {
super(context);
LayoutInflater i = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
i.inflate(R.layout.list_header_search, this);
}
@Override
public Animation getAnimation() {
return null;
}
}