-
-
Save codeforfun-jp/9ebc79df8eb9d0a28a0502f6e533ca79 to your computer and use it in GitHub Desktop.
Android Studio AlertDialog Customize - Kotlin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyDialogFragment : DialogFragment() { | |
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | |
/* 省略 */ | |
} | |
override fun onStart() { | |
super.onStart() | |
(dialog as AlertDialog).getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.WHITE) | |
(dialog as AlertDialog).getButton(AlertDialog.BUTTON_POSITIVE).setBackgroundColor(resources.getColor(R.color.orange)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment