Commit 739626f5 by 段启岩

修复PopupWindow在android5以下关闭不了的问题

parent 42d3d4af
......@@ -4,6 +4,7 @@ import android.content.Context;
import android.view.LayoutInflater;
import android.widget.PopupWindow;
import cn.yunliyunwai.beyondclouds.R;
import cn.yunliyunwai.beyondclouds.databinding.PopupMenuAddBinding;
import cn.yunliyunwai.beyondclouds.util.SizeUtils;
......@@ -14,6 +15,7 @@ public class PopupAddMenu extends PopupWindow {
super(SizeUtils.toPx(130), SizeUtils.toPx(235));
setOutsideTouchable(true);
setFocusable(true);
setBackgroundDrawable(context.getResources().getDrawable(R.drawable.background_fix_popup_window_under_android_5));
binding = PopupMenuAddBinding.inflate(LayoutInflater.from(context));
setContentView(binding.getRoot());
}
......
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#00000000" />
</shape>
\ No newline at end of file
......@@ -6,16 +6,16 @@
<cn.yunliyunwai.beyondclouds.view.BeyondTextIcon
android:id="@+id/txt_icon"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:text="@string/icon_scan"
android:textColor="#ffffff"
android:textSize="18dp"
android:textStyle="bold"
android:textColor="#ffffff"
android:background="@null"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/txt_title"
android:text="扫一扫"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment