当前位置: 代码迷 >> Android >> android中Matrix之一(图片二维旋动)
  详细解决方案

android中Matrix之一(图片二维旋动)

热度:75   发布时间:2016-05-01 19:49:11.0
android中Matrix之一(图片二维转动)
android最酷的就是它的图片切换效果,而其核心是通过Matrix类来实现的,作了个简单的小例子,可以通过点击两个按钮实现图片的左右转动,奉献以下程序代码;
页面布局matrixlayout.xml代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content">

<TextView android:id="@+id/myTextView1" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:text="hello xiaohua">
</TextView>
<Button android:id="@+id/myButton1" android:text="left"
android:layout_width="wrap_content" android:layout_height="wrap_content">
</Button>
<Button android:id="@+id/myButton2" android:text="right"
android:layout_width="wrap_content" android:layout_height="wrap_content">
</Button>
<ImageView android:id="@+id/myImageView1"
android:layout_width="wrap_content" android:layout_height="wrap_content">
</ImageView>
</LinearLayout>

  相关解决方案