I have created a custom theme for dialogs in my android app, and I was planning to override the layout used for the dialog title. I saw that in the standard android Theme there is this attribute that looks like the one to modify.
<item name="dialogTitleDecorLayout">@layout/dialog_title</item>
But when I try to override it in my Theme
<style name="Theme.Dialog.MyDialog" parent="android:Theme.Dialog">
<item name="android:windowBackground">@android:color/black</item>
<item name="android:dialogTitleDecorLayout">@layout/my_dialog_title</item>
</style>
I see the following error:
No resource found that matches the given name: attr
‘android:dialogTitleDecorLayout’
Why I not able to change it and how can I know which attributes can be changed and which not?
It is not possible to override that item like this. You have to customize the dialog with required layout and then in the layout you have to apply the theme here for what ever your requirement.
//this is the method where your dialog appears in onclick button event