I want to do this programatically:
<ImageView style="@style/TitleBarSeparator" />
Where TitleBarSeparator is:
<style name="TitleBarSeparator">
<item name="android:layout_width">1px</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:background">@color/title_separator</item>
</style>
I’ve tried:
new ImageView(getContext(), null, R.style.TitleBarSeparator);
but it doesn’t work.
I guess the error comes from passing null as AttributeSet but I am not completely sure.
I have found a way to fix it.
Still, I would like to have a way to set the style.