2014-03-06 37 views
0

在Xamarin中,是否可以在布局顶部有一个“浮动”EditText?在布局顶部浮动EditText

我在考虑一个“带到前面”的代码。

当前未显示EditText。

这里是我当前的代码:

<?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" /> 

在此先感谢

+0

请附上屏幕截图你究竟想要什么 –

+0

你确定这是你的完整的布局文件代码吗? – GrIsHu

回答

0

地方你的EditText如下的框架布局

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

只是改变你的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 
0

您使用RelativeLayout,因此您必须提供布局属性 以让我们知道视图的放置位置。

因此,使用layout_below,layout_above,layout_alignParentTop =“true”等来查看你使用的视图 。

现在你的FrameLayout覆盖了整个屏幕区域,只是应用 layout_alignParentTop =“true”以你的编辑文本视图和 layout_below用的EditText视图id的FrameLayout里。将解决您的问题。