我正在制作一个应用程序,我想要一个线性布局显示在键盘上。当用户关闭键盘时,线性布局也应该消失。 我希望它是这样的在键盘上显示一个视图
布局我想要什么
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<RelativeLayout
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/iv_Img1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/iv_Img2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:scaleType="fitXY" />
</LinearLayout>
</RelativeLayout>
<ImageView
android:id="@+id/iv_Edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:padding="5dp"
android:scaleType="center"
android:src="@drawable/cam" />
</RelativeLayout>
<LinearLayout
android:id="@+id/llEditOptions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:layout_weight="0"
android:visibility="gone" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<ImageView
android:id="@+id/iv_background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="50dp"
android:layout_toLeftOf="@+id/iv_font"
android:scaleType="center"
android:src="@drawable/save_1" />
<ImageView
android:id="@+id/iv_font"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:scaleType="center"
android:src="@drawable/cam" />
<ImageView
android:id="@+id/iv_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="50dp"
android:layout_toRightOf="@+id/iv_font"
android:scaleType="center"
android:src="@drawable/share_1" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/llCamOptions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:layout_weight="0" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/iv_Save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="50dp"
android:layout_toLeftOf="@+id/iv_Camera"
android:scaleType="center"
android:src="@drawable/save_1" />
<ImageView
android:id="@+id/iv_Camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:scaleType="center"
android:src="@drawable/cam" />
<ImageView
android:id="@+id/iv_Share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="50dp"
android:layout_toRightOf="@+id/iv_Camera"
android:scaleType="center"
android:src="@drawable/share_1" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
这是iOS手机,但是我们可以实现在安卓这个功能???
你尝试过什么吗?你在哪里编码? – Westranger 2014-09-11 12:54:50
不,我没有找到任何如何做到这一点。请问你能指导我吗? – user3917131 2014-09-11 12:55:44
aadd您的布局代码有问题 – 2014-09-11 12:56:06