안녕하세요
이제 막 안드로이드 공부를 시작한 학생입니다.
시간표를 만들어보려고 하는데
xml에 분명 버튼을 만들었는데 AVD로 실행해보면 버튼이 안나오네요 ㅠ
처음에는 테이블레이아웃부분은 스크롤가능하게 하고
하단부에 고정버튼 넣으려고 하는데 버튼이 아예안나와서
왜이러지하고 찾아보다가
maginBottom과 marginTop 이용해야 하는 걸 알아서 고쳤는데
magin으로 공간 확보했는데도 버튼이 안나오네요 ㅠ
이유가 뭔가요? 어떻게 해야 하단부에 버튼이 나올까요...?
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:layout_marginBottom="50dp">
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:stretchColumns="*" android:shrinkColumns="*">
<!-- row1 : 요일 -->
<TableRow>
<TextView android:text="@string/date" />
<Spinner android:id="@+id/spinner1" />
</TableRow>
<!-- row2 : 교시-->
<TableRow>
<TextView android:text="@string/period" />
<Spinner android:id="@+id/spinner2" />
</TableRow>
<!-- row3 : 과목명 -->
<TableRow>
<TextView android:text="@string/subject" />
<EditText android:id="@+id/edittext_subject" />
</TableRow>
<!-- row4 : 분류-->
<TableRow>
<TextView android:text="@string/category" />
<Spinner android:id="@+id/spinner3" />
</TableRow>
<!-- row5 : 강의실 -->
<TableRow>
<TextView android:text="@string/classroom" />
<EditText android:id="@+id/edittext_classroom" />
</TableRow>
<!-- row6 : Website -->
<TableRow>
<TextView android:text="@string/website" />
<EditText android:id="@+id/edittext_website" />
</TableRow>
<!-- row7 : 교수님 -->
<TableRow>
<TextView android:text="@string/professor" android:layout_span="2" android:height="40dp"
android:gravity="center_horizontal|center_vertical" />
</TableRow>
<!-- row8 : 이름 -->
<TableRow>
<TextView android:text="@string/name" />
<EditText android:id="@+id/edittext_name" />
</TableRow>
<!-- row9 : 전화번호-->
<TableRow>
<TextView android:text="@string/tel" />
<EditText android:id="@+id/edittext_tel" />
</TableRow>
<!-- row10 : E-mail -->
<TableRow>
<TextView android:text="@string/email" />
<EditText android:id="@+id/edittext_email" />
</TableRow>
</TableLayout>
</ScrollView>
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"
android:gravity="bottom" android:layout_marginTop="-50dp">
<Button android:id="@+id/ok_button" android:text="@string/ok"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:onClick="mOnClick"/>
</LinearLayout>
</LinearLayout>
가장 상위에 LinearLayout 의 orientation 을 vertical 로 해보세요.