![](/img/trans.png)
[英]I want to create bottom sheet dialog like this image below in flutter
[英]I want to open an activity as bottom sheet dialog
我有一个按钮,它 onClicked 用于另一个活动。 现在我希望活动作为bottomDialog打开。 怎么办??
if (success) {
val intent = Intent(this, PaymentActivity::class.java)
intent.putExtra("total_amount",totalAmount)
startActivity(intent)
finishAffinity()
}
我希望这里提到的 PaymentActivity 作为 bottomSheet 打开。
将您的付款活动更改为 BottomSheetDialogFragment
class PaymentActivity : BottomSheetDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.activity_payment, container, false)
}
}
你可以这样称呼它
if (success) {
val b = PaymentActivity()
b.show(supportFragmentManager, "Hi")
}
在捆绑中添加总金额。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.