0
如何将布局文件中的自定义SurfaceView旋转180度?以xml布局旋转SurfaceView
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<package.CustomSurfaceView
android:layout_width="fill_parent"
android:layout_height="0dp"
android:rotation="180"
/>
</LinearLayout>
不用说上面的代码不起作用。
但对于触摸然后输入? – Greyshack 2015-02-08 22:48:40
那么你必须在onTouchEvent期间计算它来将X和Y翻转到另一侧。 – Budius 2015-02-08 22:52:02
是的,我做到了,好的谢谢:)另外,我认为你写的部分错误,因为你必须保存画布,旋转,绘制,然后恢复。 – Greyshack 2015-02-08 23:07:42