时间:2021-07-01 10:21:17 帮助过:4人阅读
<?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>string.xml文件
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, MyTestView!</string>
<string name="app_name">MyTestView</string>
</resources>MyTextView.java文件
package org.loulijun.MyTestView;
import android.app.Activity;
import android.os.Bundle;
public class MyTestView extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}运行结果:

以上就是Android UI控件系列:TextView(文本框)的内容,更多相关内容请关注PHP中文网(www.gxlcms.com)!