有setRotation
在 API 11 中。您必须将 gridview 旋转 90 度,将子视图旋转 -90 度。
文档:http://developer.android.com/reference/android/view/View.html#setRotation(浮动)
Update:
要在视图上获得 3D 效果,遵循 API 会很有用
设置相机距离(浮动)- 设置z轴距离(深度)
setRotationX(浮动)- 设置水平轴角度
设置旋转Y(浮动)- 设置垂直轴角度
将相机距离设置为屏幕高度的一半。然后根据视图在屏幕上的位置设置旋转X。旋转角度从左到右应类似于 (20, 10, 0, -10, -20)。稍后您可以使用旋转 Y 角度来获得一些高度感知。
在扩展中进行所有设置GridView
被覆盖layout
method.
@override
void layout(int t, int l, int r, int b) {
super.layout(t, l, r, b);
...
int columnStart = getFirstVisiblePosition()/no_of_columns;
int columnEnd = getLastVisiblePosition()/no_of_columns;
loop from 'columnStart' to 'columnEnd' 'no_of_colmns' times {
// set the camera distance and rotationX to views
// depending on the position of a view on screen.
}
}