Android/기본

Android 필드 박스

Bohemian life 2012. 4. 28. 18:40
package com.commonsware.android.basic2;
//입력필드

import android.app.Activity;
import android.os.Bundle;
import android.widget.EditText;

public class FieldDemo extends Activity {

	@Override
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		setContentView(R.layout.main);

		EditText fld = (EditText) findViewById(R.id.field);
		fld.setText("버튼, 레이블과 함께 입력 필드 역시"
				+ "\"GUI 툴킷\"의 가장 핵심적인 기본 위젯 가운데 하나임");
	}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <EditText
        android:id="@+id/field"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:singleLine="false"
         />

</LinearLayout>