因此,在API级别11谷歌推出来旋转ImageView的能力(耶,之后便推出动画这样的旋转,耶智能思维的可能性,耶!)
不过,我应该如何去旋转使用,例如一个ImageView的API级别8?我不能使用setRotation()如上述。
解决方案我开始创建位图和旋转画布/矩阵,但是这并不是一个很好的解决方案。终于结束了刚刚换了绘制,如果条件得到满足。我应该说这是在细胞绘画时重复使用的ExpandableListView。
如果(isExpanded){
ImageView的观点=(ImageView的)convertView.findViewById(R.id.ImageView);
view.setImageResource(R.drawable.quickactions_button_normal_down);
}
如果(!isExpanded){
ImageView的观点=(ImageView的)convertView.findViewById(R.id.ImageView);
view.setImageResource(R.drawable.quickactions_button_normal);
}
我不是通常是一个Android开发者,但我真的很惊讶,这是可能的动画旋转,而不是静态地设置绘制的旋转。逻辑上的第一个是第二,而不是周围的其他方式的一个子集
So in API Level 11 Google introduced the ability to rotate an ImageView (Yay, after they introduced the possibility to Animate such a rotation, yay smart thinking, yay!)
But how should I go about to rotate an ImageView using e.g. API level 8? I can't use setRotation() as described above.
解决方案I started with creating BitMap and rotating the canvas/matrix, however this was not a good solution. Finally ended up just swapping the drawable if conditions are met. I should say this is an ExpandableListView where cells are reused when drawing.
if (isExpanded) {
ImageView view = (ImageView) convertView.findViewById(R.id.ImageView);
view.setImageResource(R.drawable.quickactions_button_normal_down);
}
if (!isExpanded) {
ImageView view = (ImageView) convertView.findViewById(R.id.ImageView);
view.setImageResource(R.drawable.quickactions_button_normal);
}
I'm not usually a Android developer but I'm really amazed that it is possible to animate a rotation, but not statically set the rotation of a drawable. Logically the first is a subset of the second and not the other way around.
上一篇:是否有可能加载一个新的应用领域针对不同的.NET运行时版本的组件?有可能、应用领域、组件、加载
下一篇:难道Android操作系统有一个像/ etc / passwd文件,在/ etc / shadow和/ etc / group文件?文件、有一个、操作系统、Android