view 클래스는 모든 위젯의 부모클래스 이다
따라서 위젯과 레이아웃등은 view 클래스의 속성(변수)과 메서드를 상속받는다
ID 속성
<Button
android:id = "@+id/button1"
Button mybutton;
mybutton = (Button) findViewByID(R.id.button1);
SIZE 속성
위젯은 사이즈는 layout_width(가로) 와 layout_height(세로)로 정해진다
위젯의 가로 세로는 레이아웃의 크기, 위젯 내에 글자 크기, dp값으로 정할 수 있다
<Button
android:id = layout_witdth ="match_parent" // 레이아웃 크기에 맞게
android:id = layout_witdth ="wrap_content" // 글자 크기에 맞게
android:id = layout_witdth ="300dp" // 300dp 크기
background 및 text 속성
위젯의 색상은 RGB를 통해 나타낼수 있다
RGB 앞에 투명도(Alpha)를 지정할 수 있다
위젯 안에 텍스트를 작성할 수 있다
<Button
android:id = text="버튼입니다"
android:background="#FF0000"> // 빨간색 배경설정