안드로이드 개발 질문/답변
(글 수 45,052)
안녕하세요.
현재 아이폰처럼 웹뷰와 하단의 메뉴로 구성하는 것을 만들고 있습니다.
하단의 메뉴의 기능은 메인으로 가는 기능과 웹뷰의 이전 이후 페이지를 로딩하는 기능입니다.
그런데 문제는 웹뷰와 하단의 메뉴 구성중에 웹뷰가 전체화면을 차지한다는게 문제입니다.
웹뷰의 높이값이 하단 메뉴의 상단에 붙을 수 있게 설정하고 싶습니다.
폰,탭의 화면에서 모두가 가능하게 말이죠
소스 첨부합니다.
<?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">
<FrameLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="wrap_content">
<WebView android:id="@+id/subWebView" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_weight="1.0"
android:gravity="center" />
</LinearLayout>
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:gravity="bottom">
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:background="@drawable/bar">
<ImageButton android:id="@+id/footerPrevBtn"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:background="@drawable/prev_btn"
android:layout_centerVertical="true">
</ImageButton>
<ImageButton android:id="@+id/footerNextBtn"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/next_btn"
android:layout_centerVertical="true" android:layout_toRightOf="@id/footerPrevBtn">
</ImageButton>
<ImageButton android:id="@+id/footerHomeBtn"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/home_btn"
android:layout_centerVertical="true"
android:layout_alignParentRight="true">
</ImageButton>
</RelativeLayout>
</LinearLayout>
</FrameLayout>
</LinearLayout>
답변 부탁드리겠습니다.
감사합니다.
2011.03.31 17:58:55
해결했습니다.
<?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">
<WebView android:id="@+id/subWebView" android:layout_width="fill_parent"
android:layout_height="0dp" android:layout_weight="1.0"
android:gravity="center" />
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:background="@drawable/bar">
<ImageButton android:id="@+id/footerPrevBtn"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:background="@drawable/prev_btn"
android:layout_centerVertical="true">
</ImageButton>
<ImageButton android:id="@+id/footerNextBtn"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/next_btn"
android:layout_centerVertical="true" android:layout_toRightOf="@id/footerPrevBtn">
</ImageButton>
<ImageButton android:id="@+id/footerHomeBtn"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/home_btn"
android:layout_centerVertical="true"
android:layout_alignParentRight="true">
</ImageButton>
</RelativeLayout>
</LinearLayout>
이렇게 설정하니 웹뷰는 하단의 메뉴를 따라갑니다.




이런거 하기를 원하시는거에요??
이미지 부분은 뺐습니다. ㅎㅎ
<?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">
<WebView android:id="@+id/subWebView" android:layout_width="fill_parent"
android:layout_height="0dip" android:layout_weight="1"
android:gravity="center" />
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="wrap_content">
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageButton android:id="@+id/footerPrevBtn"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:layout_centerVertical="true">
</ImageButton>
<ImageButton android:id="@+id/footerNextBtn"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_toRightOf="@id/footerPrevBtn">
</ImageButton>
<ImageButton android:id="@+id/footerHomeBtn"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true">
</ImageButton>
</RelativeLayout>
</LinearLayout>
</LinearLayout>