我试图做的唯一事情就是在顶部会有一个editText,然后会有一个ImageView。 现在最后一行会出现一些按钮(例如表情符号),只有在软键盘出现时才会将其底部向上推。当软键盘出现时,只将底部向上推
我通过附加Facebook的布局使其更加清晰。 required output
我已经经历了所有这些SO问题,也尝试了他们的答案,但没有运气。可能是我做错了什么。
Android: Resize only parts of view with soft keyboard on screen
Android: How do I prevent the soft keyboard from pushing my view up?
android : How to prevent resizing the window when displaying the virtual keyboard
我的XML代码
<ScrollView
android:id="@+id/scrollOnPost"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:isScrollContainer="false"
android:fillViewport="true"
android:layout_below="@+id/header_layout">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="4"
android:layout_gravity="bottom"
android:gravity="bottom">
<EditText
android:id="@+id/ed_post"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ImageView
android:id="@+id/img_posted_list_row"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2.7"
android:adjustViewBounds="true"
android:src="@mipmap/ic_launcher"
android:scaleType="fitCenter"
android:background="@color/red"/>
</LinearLayout>
</ScrollView>
<ImageButton
android:id="@+id/imgBtn_Emoji"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:src="@drawable/smile_face"
android:background="@drawable/button_pressed_white"
/>
所有我得到我的软键盘总是把整个布局了不是在底部刚表情符号。谢谢。
看到这个链接它可能会帮助你:http://stackoverflow.com/questions/17410499/difference-between-adjustresize-and-adjustpan-in-android –
感谢链接库纳尔。我已经尝试了“adjustResize”,“adjustPan”,并且两者都在清单中,但结果不是我所需要的。但问题是我有同样的问题。再次感谢。 –
@ Md。Asaduzzaman Noor il尝试在我的代码中添加布局,以及c我可以找到什么解决方案 –