-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
For context, I am displaying the items on a phone and want to reduce the space taken by a horizontal TabStrip in portrait mode. |
Beta Was this translation helpful? Give feedback.
-
This style applies the margin correctly: <Style Selector="TabStripItem:not(:selected) /template/ ContentPresenter#headerContent">
<Setter Property="Margin" Value="50,100,100,50"></Setter>
</Style> The selector is used in the original style to specify opacity. I can understand why the selector is sufficient to apply the margin but not why it is necessary. |
Beta Was this translation helpful? Give feedback.
-
It doesn't work because of priority. Since it has been set inside a template it has a And your style can't override it. I've changed it and now you can override it. Use <Style Selector="TabStripItem /template/ ContentPresenter#PART_HeaderContent">
<Setter Property="Margin" Value="50,100,100,50"></Setter>
</Style> |
Beta Was this translation helpful? Give feedback.
It doesn't work because of priority. Since it has been set inside a template it has a
LocalValue
priority:Material.Avalonia/Material.Styles/Resources/Themes/TabStripItem.axaml
Line 21 in fe103bd
And your style can't override it.
I've changed it and now you can override it. Use