마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

웹뷰랑 버튼 같이 사용하고싶은데 오류가 납니다.

0 추천

레이아웃 문제인건 확실합니다.

근데 제 상식선에서는 되야되는데..

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <WebView
        android:id="@+id/webview"
        android:layout_width="fill_parent"
        android:layout_height="400dp" />

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <button
            android:id="@+id/btn1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="이동" />

        <button
            android:id="@+id/btn2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="이동" />

        <button
            android:id="@+id/btn3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="이동" />

        <button
            android:id="@+id/btn4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="이동" />

        <button
            android:id="@+id/btn5"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="이동" />
        <button
            android:id="@+id/btn6"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
     android:layout_weight="1"
            android:text="이동" />
    </LinearLayout>

</LinearLayout>

 

 

위사진처럼 제작하고싶은데 오류가생깁니다.

웹뷰만 했을때 문제없는데 버튼만 추가할려고하면 문제가 생기네요.

공대학생 (180 포인트) 님이 2014년 12월 5일 질문

2개의 답변

0 추천

<WebView
        android:id="@+id/webview"
        android:layout_width="fill_parent"
        android:layout_height="400dp" />

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

이부분을 아래처럼 한번 바꿔보세요.

안된다면 아래 버튼들 감싸고 있는 LinearLayout에도 weight를 줘 보세요..



<WebView
        android:id="@+id/webview"
        android:layout_width="fill_parent"
        android:layout_weight="1"
        android:layout_height="0dp"
/>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

 

한드로이등 (810 포인트) 님이 2014년 12월 5일 답변
0 추천
button 이 아니고요 Button이요
건방진프로그래머 (26,630 포인트) 님이 2014년 12월 5일 답변
...