계산기 Layout - Linear Layout
---가장 큰 레이아웃--- android:layout_width="match_parent"
android:layout_height="match_parent" 를 기본으로 한다.
android:orientation="vertical"
----TextView ---- android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="5"
----BUTTON----- android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1"
// 각 horizontal라인마다 차지하는 비율을 말한다.
// 아래 sample에서는 textview의 LinearLayout weight은 4~5, Button 한 줄의 LinearLayout weight은 1로 한다.
'내 공부 > 안드로이드' 카테고리의 다른 글
Android Listener 개념 이해 (0) | 2015.02.09 |
---|---|
Android Application 타이틀바 제거 (0) | 2015.02.09 |
Android Splash screen (0) | 2015.02.02 |
안드로이드 JAVA Listener 사용 (0) | 2015.01.29 |
안드로이드 기본 (2) | 2015.01.27 |
Log.d(tag,msg)
msg의 내용을 보여준다.
Log.e(tab,msg)
Toast Message 유저에게 알림 메세지
Toast.makeText(getApplicationContext(), "gayeon toast message", Toast.LENGTH_LONG).show();
: adroid application context에 두번째 아규먼트를 넣어 보여준다.
activity_main.xml 파일에서
android:id="@+id/gayeonButton"
는 gen/R.java에
public static final class id {
public static final int gayeonButton=0x7f060000;
}
로 저장된다. >> xml에서 만든 gayeonButton을 자바에서 사용하기 위해서
'내 공부 > 안드로이드' 카테고리의 다른 글
Android Listener 개념 이해 (0) | 2015.02.09 |
---|---|
Android Application 타이틀바 제거 (0) | 2015.02.09 |
Android Splash screen (0) | 2015.02.02 |
안드로이드 JAVA Listener 사용 (0) | 2015.01.29 |
안드로이드 layout - 예제:계산기 (0) | 2015.01.28 |
내일은 쉬지말고 300개씩 3세트 900개 도전