Мне нужно кастомизировать Spinner DropDown, чтобы у него были закругленные углы.
скрин
Пытался сделать цвет transparent с помощью данного
решения. Не помогло.
Layout:
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/messageSubject"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textAppearance="@style/Text.Default.Normal"
android:background="@color/transparent"
android:minHeight="@dimen/grid_6_25"
android:layout_marginTop="@dimen/grid_1_75"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/supportQuestion" />
Fragment:
class SupportFragment : Fragment(R.layout.fragment_support) {
private val viewBinding by viewBinding<FragmentSupportBinding>()
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initView()
}
private fun initView() {
val adapter = ArrayAdapter.createFromResource(
requireContext(),
R.array.message_subject,
R.layout.spinner_selected
).also { adapter ->
adapter.setDropDownViewResource(R.layout.spinner_dropdown)
}
viewBinding.messageSubject.adapter = NothingSelectedSpinnerAdapter(requireContext(), adapter, R.layout.spinner_hint)
}
companion object {
fun newInstance() = SupportFragment()
}
}