Button background alignment - ios

I'm a long-time web dev trying to get into iOS development and Xcode so please forgive me for the simplest of questions.
I have a strange issue when I cannot centre align button text within a button's background image. Please see the screenshot below. At the moment you can see the text sits right aligned to the background image.

It’s not a background image. Think of it more like an icon.
It looks like you might want to set your Style to “Default”. Then it will show a background field under image

Related

How to set dark background for iOS10 today widget

I'm trying to workout how to set the background of an iOS 10 today extension/widget to what looks like a default dark mode. In the image below you can see the Weather Underground today widget and it is dark. There are a few apps with a dark background and they all look like the same background/style so I'm thinking it maybe a specific dark mode that can be set in code rather than just fiddling with the view controller color/transparency - no matter how much I try to set the color and transparency manually in the story board I can't even get close to this effect.
You can't do this. The apps that look like this, are not updated for iOS 10 yet. You can see that it hasn't been updated, because it is expanded without showing the "Show less"/"Show more" button.

Left constraints in Xcode 7

So I'm doing a tut on iOS 9 development with Xcode 7, and in the example I'm currently doing the instruction is adding constraints using ctrl+drag and clicking on a second image. Now my issues isn't with that process, my issue is when the video asks me to set left constraints (the right image attached) I don't have that option (the left side of the image attached). I tried "leading" just to see what it would do and it did not achieve desired results. I'm guessing that this is changed in Xcode 7 and there is a new method of achieving this result?
Any help is appreciated, thanks!
EDIT: To update my question as per a suggestion below, here's what's happening. I have a background image view. When I am lining up image buttons along the background image, the first one is just fine, once I select the second one, and add the leading constraint, then lock in the width and height in the main constraints - it flies off the page somewhere. The background image is horizontally and vertically aligned to the container, and the main reason I'm doing this is I have "landscape mode" pulled up in a main preview window and I want to make sure that everything is looking good in that mode.
I have tried starting a new project all together and I get the same result. Again the tutorial I'm following was using Xcode 7 beta, so not sure if that has something to do with it. I'd like to lock in on the problem instead of skipping over it in case I run into this in the future.
Thanks!
Try using the main constraints menu at the button of Xcode.
See below screenshot: click the element you want to add a constraints to and it will give you the options you need.
Cheers,
Tal

iphone simulator only shows the background images not the labels and text box, why is this?

This is a simple iOS mobile app exercise. I have a image as a background, and then the labels and text box are added. I run the simulator and it shows correctly. but after a while I run the simulator again, the simulator only shows the background image, the text box and labels are not there anymore. I restart writing everything many time and the same thing happen at some point. This is driving me crazy. Did anyone know what is going on here??? Thank you so much in advance for your help!!!
if you done with story board than your object must be in right order.
Right/Proper Way
Wrong Way
I supposed you drag all button, label,text box objects in the storyboard. All the thing are supposed to disappear if you do not used any Layout stuff. Please try AutoLayout.
Or if you write the code to show your label in viewDidLoad(), please add the objects to your subview as self.view.addSubview(yourObjects).

How to access the system selected menu item blue color?

I'm working on an app that has a custom NSView on a NSStatusBar which performs all of the drawing when the user clicks it. But here's the problem, the color I'm currently drawing as the view's background color is not the same as the system blue color.
My app's color:
Twitter's menu item color (system):
As you clearly see, my blue color is way lighter than the system. This is the code I'm currently using (and worked perfectly on versions older than Yosemite):
[[NSColor selectedMenuItemColor] set];
NSRectFill(rect);
I've even tried color picking the menu item's color but it seems like the color is affected by the wallpaper below the menu bar.
Any ideas on how to achieve the system look?
As you said, in Yosemite, docks, status bars etc. are affected by whatever is behind them. Try enabling System Preferences > Accessibility > Display > Reduce Transparency and you'll see what your color looks like without this feature./
Here is an idea - Maybe you should use the Vibrancy effect and derive from NSVisualEffectView. I knew that I've seen a very similar thread somewhere here in the past, and it took me quite some time to find it. Here it is:
Trouble matching the vibrant background of a Yosemite NSMenuItem containing a custom view
I think Matthes' answer to that question would lead you to the resolution of your issue. Be sure to check it out. I hope it will help - Good luck and report back!

UITabBar Image is not clear

I just recently got a new set of icons for my app (from an external designer) and I am trying to implement them, but for some reason it ends up looking like this (the new icon is the one in the middle):
I have tried setting the image of the tab bar to have UIImageRenderingModeAlwaysOriginal, but that's given me no luck.
Here's the icon (it kind of blends into the background but its a white envelope):
Any reason why this is happening and how I can fix?
The problem is that the entirety of your image is opaque - at least part of it needs to be transparent to appear as you want it to.
In the below image (since the entire thing is white now, it's directly below this text), I have removed the black line and made that transparent. I then added this image to a tab bar, and it worked fine for me.
Here's the link to the image, as well.
What I ended up doing was setting using UIImageRenderingModeAlwaysOriginal for the tabbar image in the awakeFromNib method...that seemed to fix the issue.

Resources