请教一下点击穿透的问题
Iridescentangle opened this issue · 4 comments
Iridescentangle commented
Iridescentangle commented
补充一下截图
是不是我哪里打开方式不对...贴一下DialogScene的代码
class CommonAlertScene : Scene {
private lateinit var msg: String
private var type: Style = Style.Default
enum class Style{Default,NoIcon}
constructor(msg:String, type:Style):super(){
this.type = type
}
constructor(msg:String):super(){
this.msg = msg
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup,
savedInstanceState: Bundle?
): View {
return inflater.inflate(R.layout.layout_common_alert,container,false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
view.setBackgroundColor(Color.parseColor("#99000000"))
view.tv_msg?.setText(msg)
view.btn_confirm?.onClick {
navigationScene?.pop()
}
}
}
qii commented
你在 onViewCreated 补一段 view.setClickable(true)
Iridescentangle commented
你在 onViewCreated 补一段 view.setClickable(true)
果然好用,虽然不明白为啥。。。谢谢!
Ccixyj commented
@Iridescentangle
点击进入事件被view消费了