开发者

How to delete background of rounded corner popup window?

开发者 https://www.devze.com 2022-12-07 20:42 出处:网络
I created a popup window with rounded corners in a fragment but when I open it I can see a dark background behind the popup. Can you tell how to delete it or make ir transparent?

I created a popup window with rounded corners in a fragment but when I open it I can see a dark background behind the popup. Can you tell how to delete it or make ir transparent?

I'm using kotlin.

This is my fragment code (the activity with an image that opens the popup on click):

`

class ProfileFragment : Fragment() {

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        // Inflate the开发者_运维知识库 layout for this fragment
        return inflater.inflate(R.layout.fragment_profile, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        val bpMore: ImageView = view.findViewById(R.id.ic_bp_more)

        bpMore.setOnClickListener {
            val showPopUp = BadgesPopUpFragment()
            showPopUp.show((activity as AppCompatActivity).supportFragmentManager, "showPopUp")
        }
    }

`

And this is my popup fragment code (popup window):

`

class BadgesPopUpFragment : DialogFragment() {

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_badges_pop_up, container, false)
    }
}

`

0

精彩评论

暂无评论...
验证码 换一张
取 消