I did a search on this and found many posts about changing the background color and all of them were showing result about changing the background color of the VIEWS in the project.
THIS IS NOT WHAT I WANT
I want to change the background of the default template. I like the current default template settings but when I open storyboard it has a white background and the views in it also have the same color making it hard to see.
I looked in the preferences but could not see how to change just the BG color of the storyboard layout screen
Any ideas?
Related
My goal is to view the content of the bottom page from the top of the other content page. In order to accomplish this, I used PushModalAsync to navigate and set the BackgroundColor property of the navigation page to Transparent. I can view the content on the bottom page on Android. However on the iOS platform, a black color is always displayed and I am unable to read the content of the bottom page. Why is the background color always black even when it is set to be transparent in PushModalAsync?
Note: The iOS platform displays a white screen when I change the navigation to PushAsync.
Expected Behavior:
Background color should not be black and it should be transparent when navigating using PushModalAsync
Actual Behavior:
Background color is always black even when the content page background color is set as transparent when navigating using PushModalAsync
Android Screenshot
iOS Screenshot
The issue reproducing sample is provided below:
DemoSample
If you want to do EXACTLY like that, it is not possible (it will require so much work that you can't expect someone to provide you the solution here).
On iOS that control (ViewController) is drawn that way in that presentation mode. So as long as you use that control and that mode it will work that way irrelevant if you use Xamarin or something else. As ViewControllers are most basic controls it is not realistic to replace them with something else. But you can replace presentation mode. In Xamarin.Forms you can do that this way:
<ContentPage ...
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
ios:Page.ModalPresentationStyle="FormSheet">
...
</ContentPage>
This will result in somewhat different visual presentation but that is the only way to have one ViewController drawn over another without going into some deep customization that would require tons of code, especially on Xamarin.Forms.
You can also try some other values, but the default value will not work.
In iOS, the hierarchy is managed by the view controller. Each page has a separate view controller. A page consists of a window, a root view, and a subview. You cannot see the layout of the previous page by setting the background color to be transparent.
For more details, you can refer to the following documents:
User interface | Microsoft
The View Controller Hierarchy | Apple
I'm in Kotlin using the default Action Bar in the main activity:
setSupportActionBar(binding.toolbar)
I see that there are several elements controlling the color of the Title, it's background, the toolbar background and the buttons on the bar. There must be a way to set the entire toolbar one color and the buttons another color. I'm using styling and XML and code to set a lot of colors elsewhere for day/night modes but I can't change the colors of these buttons. Code takes precedence over all and so I prefer Kotlin code. But it doesn't cover everything like the styling XML code does.
EDIT by author August 18, 2022:
Possibly last comment here because this is not possible. One writer here in SO admitted it was easier to build toolbars in each fragment with independent buttons than use the default main activity toolbar. I've done that with success and in adding the ability to slide between fragments but that is not what I think the compiler designers would have hoped for.
With the main activity toolbar, the buttons come from vector assets with their own XML files. If the fill color is changed in those files with this:
android:tint="?attr/colorControlNormal
and this in for example a night theme:
<item name="android:colorControlNormal">#color/yellow_text</item>
I can't get the colors in a button to change at all.
It's the same as in checkbox properties where the background of the checkbox background is tied to the background of the actual background of the "form" itself showing as a page (the main activity and fragment) on an Android. I can't change the background color of the tick mark in the checkbox either. A default seems to be taking over in the day/night themes.
How do I get the new toolbar item style of OSX Yosemite?
I created a standard toolbar, but the buttons don't have that button-like look. Do I need to drag actual buttons to the toolbar to get this look?
What I have:
What I want (that round bezel and white background):
There are two types of items in toolbars, image items and view items. It looks like you have an image item. You seem to want a view item where the view is an NSButton configured as a round textured button. So, yes, you should drag actual buttons to the toolbar.
I would not attempt to control the button background. You should use the button as-is to get the default system appearance. Apple recommends using a PDF template image (all black with the alpha channel used to make the image). The button itself would not have a title/label. Rather that would be on the containing toolbar item.
It looks like you may have applied an internal blue "glow" or highlight to your image. Generally, you should not do that. Let the frameworks apply appropriate effects to the template image automatically based on the button state and shows-state-by mode.
Toolbars in the Human Interface Guidelines
Controls which are appropriate to use in the window frame (including the toolbar)
Designing images for toolbar buttons
Works just fine for my Cocoa app under Yosemite -
are you actually setting the template property for your icon images..?
From the NSImage docs:
The 'template' property is metadata that allows clients to be smarter
about image processing. An image should be marked as a template if it
is basic glpyh-like black and white art that is intended to be
processed into derived images for use on screen.
In my project I created some custom popups. Just like for example the UIActionSheet I would like to create an overlay, disable other interactions and gray out the tintColor of the UITabBar buttons, UINavigationBar buttons and so on.
As for now I've managed to fix this by manually creating a background overlay, disable the interaction by adding this overlay over other views and change the tintcolor manually.
I've searched for an API method to automatically solve this problem, but without success.
Hoping to find some good suggestions here at SO.
Edit
The answer I was looking for is called tintAdjustmentMode:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/#//apple_ref/occ/instp/UIView/tintAdjustmentMode
Add a new view in your xib
set background color as a black color and set the opacity to 50%
Create your popup on this view.
Put this view in the main view.
Finally just hide & unhide this view according to your requirement.
In this you don't need to disable any other control.
I'm working with white text (labels) in Xcode, and currently I can't see them because the background of the storyboard is also white. How do I change the appearance of the storyboard?
To clarify, I do not want my text to change color, I only want to change the appearance of the storyboard so that I can develop more easily.
If you are referring to the white in your view controller:
Select the View
Go to inspector (right panel, 4th item)
Change the background color field (section view)
I'm not sure you can do what you're trying to achieve. My best advice to you would be to create a dark coloured UIView which you can place behind the UILabel. Once you're happy you've got the UILabel setup the way you want it you can then just delete the UIView.