When including a 3D plot inside a TabView, in my computer, the entire tab is grayed as if it was a giant button, leaving the Graphics with a white background:
To avoid the contrast between the gray and the white, I would prefer that the tab also had a white color.
Tried BaseStyle -> {Background -> White}
but with no success (only the borders get restyled).
How can I change the Background color of the tab?
Step 1: Create a Model and ViewModel classes in Sample. Step 2: Create the Color property in the ViewModel class, and then set the color value. Step 3: Bind the Color property into View in the TabHeaderBackgroundColor property.
Press Cmd+N to create a new SwiftUI View, calling it “MainView”. Creating tabs is as easy as putting different views inside an instance of TabView , but in order to add an image and text to the tab bar item of each view we need to use the tabItem() modifier.
The default background is not white but transparent for graphics, so there's no harsh contrast. Background -> White
makes the background white and leaves the borders, quite the opposite of what you said. BaseStyle
doesn't seem to do anything.
This is what I get on Windows XP:
EDIT: An alternative is a custom TabView
-implementation along the following lines:
objects = Table[Plot[f[x], {x, 0, 10}], {f, {Sin, Cos, Exp}}];
Column[
{SetterBar[Dynamic[x], Thread[objects -> Range@Length[objects]]],
Dynamic[x]}
]
This is unfinished, but the basics work, and it shows you how to do it yourself.
This seems to be an OS specific problem. On OS X, TabView
does have a grey background (albeit very light), even with Background->White
. For example
TabView[Table[Plot[Sin[i x], {x, 0, 2 Pi}, Background -> White], {i, 4}],
Background->White]
produces this
I can confirm Heike's assertion for Windows 7.
If you wish to always overwrite the system theme color for TabView
boxes, you may evaluate:
SetOptions[$FrontEnd,
TabViewBoxOptions -> {Background -> GrayLevel[1]}
]
Using either the "Windows 7 Basic" or "Windows 7 Aero" theme, I see this:
However, using the "Windows Classic" theme I see this:
If, using the Classic theme, I open Window Color and Appearance
and change the 3D Objects
Color 1
to white, I see:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With