-
Beta Was this translation helpful? Give feedback.
Answered by
SKProCH
Oct 2, 2023
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.
0 replies
-
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.
0 replies
-
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.
1 reply
Answer selected by
kevkov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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