0
Я бы хотел, чтобы мой RelativeLayout, содержащий мой EditText и мой ImageButton, всегда оставался липким и полным в верхней части клавиатуры.EditText в палочках RelativeLayout поверх клавиатуры
Клавиатура всегда отображается, когда отображается диалоговое окно.
Это должно выглядеть как поведение приложения YouTube при отправке комментария.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<EditText
android:id="@+id/comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Add anonymous comment"
android:textAppearance="@style/CodeFont" />
<ImageButton
android:id="@+id/submit_comment"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:background="@null"
android:scaleType="fitXY"
android:src="@drawable/send_red" />
</RelativeLayout>
DialogComment dialogComment = new DialogComment(mainActivity, WPPostDataView.this);
dialogComment.show();
//Grab the window of the dialog, and change the width
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
Window window = dialogComment.getWindow();
lp.copyFrom(window.getAttributes());
//This makes the dialog take up the full width
lp.width = WindowManager.LayoutParams.MATCH_PARENT;
lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
window.setAttributes(lp);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// request keyboard
this.getWindow().setSoftInputMode (WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
Это почти идеальный. Мне просто нужно, чтобы белая секция над LinearLayout была прозрачной черной (как пустое диалоговое окно) –
создать линейную линию над этим – Shanto
Не могли бы вы дать мне более подробную информацию? –