일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- Validations
- 전체
- 자바
- 상속
- jquery
- Login with OAuth Authentication
- 이클립스
- 상속예제
- full text indexing
- 야구게임
- 25가지 효율적인 sql작성법
- while
- 가변인자
- angular2
- Random
- 자바 야구게임
- 추상클래스
- 다운캐스팅
- 전자정부
- Full text
- 스프링
- 전체텍스트
- 단축키
- 업캐스팅
- IBatis procedure
- 다형성
- 로또
- 형변환
- 페이징
Archives
- Today
- Total
nalaolla
table_layout 본문
728x90
반응형
MainActivity.java
- package com.test.android04tablelayout;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.util.Log;
- import android.view.View;
- import android.widget.Button;
- import android.widget.EditText;
- import android.widget.Toast;
- public class MainActivity extends AppCompatActivity {
- private EditText edit_name;
- private EditText edit_tel;
- private Button btn_send;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- edit_name = (EditText)findViewById(R.id.edit_name);
- edit_tel = (EditText)findViewById(R.id.edit_tel);
- btn_send = (Button)findViewById(R.id.btn_send);
- btn_send.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- Toast.makeText(getApplicationContext(),edit_name.getText() +"/"+edit_tel.getText(), Toast.LENGTH_LONG).show();
- }
- });
- Log.i("testlog", edit_name.getText() +"/"+edit_tel.getText());
- }
- }
activity_main.xml
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout 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:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="com.test.android04tablelayout.MainActivity">
- <TableLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_centerVertical="true"
- android:layout_centerHorizontal="true">
- <TableRow
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:text="@string/text_name" />
- <EditText
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:id="@+id/edit_name"
- android:layout_weight="1"
- android:hint="이름" />
- </TableRow>
- <TableRow
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:text="@string/text_tel" />
- <EditText
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:inputType="textPersonName"
- android:ems="10"
- android:id="@+id/edit_tel"
- android:layout_weight="1"
- android:hint="연락처" />
- </TableRow>
- <TableRow
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <Button
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/btn_send"
- android:width="20dp"
- android:id="@+id/btn_send"
- android:layout_column="1" />
- </TableRow>
- </TableLayout>
- </RelativeLayout>
728x90
반응형