2

I have a small application with the camera and I have a device which is not a problem but if I can change the app will improve much aesthetically.

I put the xml code of the activity:

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    android:id="@+id/layout">



    <FrameLayout 
        android:id="@+id/preview"
        android:layout_weight="1" 
        android:layout_width="fill_parent"
        android:layout_height="0dip">

    </FrameLayout>



    <Button
        android:id="@+id/buttonClick"
        android:layout_width="109dp"
        android:layout_height="105dp"
        android:layout_gravity="center"
        android:background="@drawable/obutrador2" >

    </Button>

</LinearLayout>

When I run the application, there is a white stripe along the entire height of the screen occupied by the button. How I can fix this? It would make the button appear above the image that the camera is capturing, as the app that has the default phone.

The problem is how to position the frame layout so that it fills the screen and center the button at the bottom. If I make the FrameLayout full-screen, the button disappears.

I leave a link to a photo of what happens: https://www.dropbox.com/s/jbns8jddtwxjhdp/IMAG0348.jpg

4

1 に答える 1

1

このようにFrameLayout内にButtonを定義する必要があると思います。フレームレイアウトを親レイアウトとして作成し、ボタンを好きな場所に配置できます

<FrameLayout 
        android:id="@+id/preview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    <Button
        android:id="@+id/buttonClick"
        android:layout_width="109dp"
        android:layout_height="105dp"
        android:layout_gravity="center"
        android:background="@drawable/obutrador2" >

    </Button>

</FrameLayout>

これがあなたのために働くことを願っています...ありがとう

于 2013-02-23T01:29:24.593 に答える