简体   繁体   中英

Floating EditText on top of Layout

In Xamarin, is it possible to have an EditText "floating" on top of a Layout?

I am thinking of a "Bring to front" sort of code.

Currently the EditText is not showing.

Here is my current code:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:padding="5dip">
<EditText
    android:id="@+id/inputSearch"
    android:layout_width="fill_parent"
    android:layout_height="49.1dp"
    android:hint="Find..."
    android:inputType="textVisiblePassword"
    android:layout_marginBottom="15.2dp" />
<FrameLayout
    android:id="@+id/mapWithOverlay"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/thumbnail" />

Thanks in advance

将您的edittext放在框架布局下面

<FrameLayout ... /> <Edittext .../>

Just Change the below property of your FrameLayout

 <FrameLayout
    android:id="@+id/mapWithOverlay"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:layout_below="@id/inputSearch" /> <---- Change it to the id of EditText

Your using the RelativeLayout so you have to provide the layout property to let know the views where to place them.

So use the layout_below, layout_above, layout_alignParentTop="true" etc to the views your using.

Now your FrameLayout covers up the whole screen area, just apply the layout_alignParentTop="true" to your edit text view and layout_below with the edittext view id to the FrameLayout. will resolve your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM