XML文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<LinearLayout
android:id="@+id/linearLayout"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<ImageView
android:id="@+id/imgView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/boy_img"
></ImageView>
<ImageView
android:id="@+id/imgView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/boy_img"
></ImageView>
</LinearLayout>
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<Button android:id="@+id/btm1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="镜像"
android:onClick="jingxiang"></Button>
<Button android:id="@+id/btm2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="倒影"
android:onClick="daoying"></Button>
<Button android:id="@+id/btm3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RGBA"
android:onClick="RGBA"></Button>
<Button android:id="@+id/btm4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="亮度"
android:onClick="liangdu"></Button>
<Button android:id="@+id/btm5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="饱和度"
android:onClick="baohudu"></Button>
</LinearLayout>
</LinearLayout>
java文件:
package com.zdzyc;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
public class MainActivity extends Activity {
private final String TAG="zdzyc";
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
public void jingxiang(View view){
Log.v(TAG, "jingxiang");
}
public void daoying(View view){
Log.v(TAG, "daoying");
}
public void RGBA(View view){
Log.v(TAG, "RGBA");
}
public void liangdu(View view){
Log.v(TAG, "liangdu");
}
public void baohudu(View view){
Log.v(TAG, "baohudu");
}
}