안드로이드 개발 질문/답변
(글 수 45,052)
안녕하세요 ~ 레이아웃을 잡고 있는데, LinearLayout 과 ScrollView로 여러가지 해보는데,
원하는 위치를 잡지 못해서 질문을 드립니다;;
현재 잡아놓은(?) 것은. 첨부된 파일의 dy1.JPG에 보시면,
까~~만 화면에 하단에 버튼 2개가 있습니다. '추가'버튼을 누르면 텍스트뷰가 하나씩 추가 되면서,
버튼들이 밑으로 조금씩 내려가게됩니다..
삭제를 누르면 위로 조금씩 올라가고요;;;
근데 이것을 처음 로드했을때, 버튼을 가장하단에 위치하고, 그대로 고정시켜놨으면 합니다..
android:layout_gravity="bottom" 이런 옵션들을 써봤는데;; 어디가 잘못된건지;; 먹히지가 않네요 ;; =,=;;
어떻게 변경을 해야할지;;; 조언 좀 부탁드려요,,,
소스는..
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbarStyle="outsideOverlay"
android:id="@+id/scv1"
android:layout_weight="9"
>
<LinearLayout android:id="@+id/dynamicArea"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/> <!-- 이곳이 텍스트뷰가 추가되는 영역. -->
</ScrollView>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="bottom">
<Button android:id="@+id/pushButton"
android:text="Tv추가"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="50"/>
<Button android:id="@+id/popButton"
android:text="Tv삭제"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="50"/>
</LinearLayout>
</LinearLayout>
이렇게 입니다...
좋은하루 되세요~




여기서 height를 fill_parent로 바꾸시면 될것 같습니다