안드로이드 layout - 예제:계산기
내 공부/안드로이드

계산기 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
800개
작심1일/복권긁는중
줄넘기 800개 성공!!
내일은 쉬지말고 300개씩 3세트 900개 도전

- 옥상에서

'작심1일 > 복권긁는중' 카테고리의 다른 글

체력기르기  (0) 2015.02.12
오늘은 1800개  (2) 2015.02.03
7곡 들으면서!  (0) 2015.02.03
노래 10곡 들으면서  (0) 2015.02.01
700개  (3) 2015.01.19