标签:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity" > <Button android:id="@+id/bt" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="button" /> <TextView android:id="@+id/tv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="25sp" /> </LinearLayout>
package com.example.openproject01afinalactivity; import net.tsz.afinal.FinalActivity; import net.tsz.afinal.annotation.view.ViewInject; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; public class MainActivity extends FinalActivity { @ViewInject(id = R.id.bt, click = "btClick") Button bt; @ViewInject(id = R.id.tv) TextView tv; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void btClick(View v) { tv.setText("Afinal开源框架中 \nFinalActivity的使用!"); } }
标签:
原文地址:http://www.cnblogs.com/bhlsheji/p/4202264.html