Affichage des articles dont le libellé est heading. Afficher tous les articles
Affichage des articles dont le libellé est heading. Afficher tous les articles

mercredi 12 août 2015

Screen layout problem - text field superimposed on app heading bar



The contents of my layout file is below.

Everything is good except that the control "android:id="@+id/text_bluetooth"" is superimposed over the top of the app heading and laucher icon.

I can't figure out how to move all the controls down below the app heading while retaining their same overall arrangement.


Code:


<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#0099cc"
    tools:context=".HexapodControls"
    android:id="@+id/frame_controls"
    android:visibility="visible">

    <!-- The primary full-screen view. This can be replaced with whatever view
        is needed to present your content, e.g. VideoView, SurfaceView,
        TextureView, etc. -->

    <!-- This FrameLayout insets its children based on system windows using
        android:fitsSystemWindows. -->

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:visibility="visible"
        android:id="@+id/layout_controls">

        <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:text="@string/str_select"
                android:id="@+id/text_bluetooth"
            android:visibility="visible"
            android:layout_gravity="top|left"
            android:autoText="false"
            android:typeface="normal"
            android:textSize="18dp" />

        <Spinner
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/spinner_bluetooth"
            android:visibility="visible"
            android:clickable="true"
            android:layout_gravity="top|left" />

        <LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
            android:id="@+id/layout_bluetooth"
            android:keepScreenOn="true">

            <Button
                        android:layout_width="160dp"
                        android:layout_height="match_parent"
                        android:text="@string/str_connect"
                        android:id="@+id/button_connectbt"
                        android:clickable="true"
                        android:enabled="false"
                        android:focusable="false"
                        android:focusableInTouchMode="false"
                        android:gravity="center_vertical|right"
                        android:drawableLeft="@mipmap/ic_bluetooth"
                    android:layout_gravity="center_horizontal|top"
                android:onClick="@string/str_onclick_connectbt"
                android:visibility="visible"
                android:textSize="18dp" />

            <Button
                    android:layout_width="160dp"
                    android:layout_height="match_parent"
                    android:text="@string/str_disconnect"
                    android:id="@+id/button_disconnectbt"
                    android:enabled="false"
                    android:focusable="false"
                    android:focusableInTouchMode="true"
                    android:clickable="true"
                    android:gravity="center_vertical|right"
                    android:drawableLeft="@mipmap/ic_bluetooth"
                android:onClick="@string/str_onclick_disconnectbt"
                android:visibility="visible"
                android:layout_gravity="top"
                android:textSize="18dp" />
        </LinearLayout>
    </LinearLayout>

</FrameLayout>