0
我正试图在软键盘加载时调整我的屏幕。正常的屏幕看起来像这样。 软键盘发行
但是,当用户单击EditText时,视图会中断并出现如下所示。在我的清单的活动我加入以下机器人:windowSoftInputMode =“adjustResize”
我想什么发生的是,无论是在底部的按钮出现,且整个EDITTEXT没有被切割可见当用户点击EditText时。
编辑:将以下行添加到我的活动getWindow()。setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);使我的视图看起来像这样。但我还是希望我的两个按钮出现在EditText上
XML为底部的EditText底部和按钮
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1.6 "
android:background="#FFFFFF"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<EditText
android:hint="Enter your Message"
android:ems="10"
android:id="@+id/messageET"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<RelativeLayout
android:background="@drawable/lightrectangle"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="2.5">
<ImageButton
android:id="@+id/addimgbtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:background="#f6f6f6"
android:paddingLeft="10dp"
android:src="@mipmap/blueadd" />
<TextView
android:paddingLeft="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Add an image"
android:id="@+id/textView4"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/addimgbtn"
/>
</RelativeLayout>
<RelativeLayout
android:background="@drawable/lightrectangle"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="2.5">
<ImageButton
android:id="@+id/sendbtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:layout_weight="2.5"
android:background="#f6f6f6"
android:src="@mipmap/bluesend" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Send Message"
android:id="@+id/sendmsgTV"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/sendbtn"
android:paddingLeft="10dp"
/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
你将有权发布至少布局的一个简化版本。调整大小是你想要的,但需要有一个实际上可以调整大小的视图。 –
@GabeSechan我需要调整什么? – revipod
该中央清单需要收缩。 –