How can i make a UITabBar without Images? I just want text, centered in the buttons.
If by "centered", you mean "horizontally-centered", I would just use fully transparent PNG images for your design.
I you also mean "vertically-centered", there's no way to achieve this with UITabBar and text.
Maybe you can trick it by using an empty text for your tab but creating images for the text you want but the text will be rendered blue and it might be ugly/not meet Apple's standards so I would strongly advise you against it.
Related
I am developing an app and I am currently working on the login page and I cannot get the Textfields and buttons to line up with the backgrounds. The app only uses portrait view.
iPhone 7s plus
If there are any more questions ask me and I can answer those.
Login Page without buttons or textfields
You will likely be continuously frustrated trying to match up your text fields, labels and buttons with a "full screen" background image, simply because of the differences in screen dimensions.
I think you'll be much better off using:
a plain background gradient
the "logo" image with transparent background
the text-entry "box" + fields as a custom view
buttons as buttons
Then, use constraints (and possibly a UIStackView or two) to arrange those elements relative to each other.
You could try for the constraints, which could make your app use for any of the modes (landscape or portrait).Try referring to this video it is really helpful
https://www.youtube.com/watch?v=7iT9fueKCJM.
I find it difficult to describe what I want to achieve. I looked for a picture to show:
(image link: https://d13yacurqjgara.cloudfront.net/users/7017/screenshots/351285/button.gif)
You see that the text color of "3/4" changes to white when the bar reaches it. How can I achieve this with swift?
My idea is to have two UIViews, with the exact same content (except for the text color) and blend one over the other by resizing a mask or something.
The problem is that I would have to deal with duplicate content. If I wanted to change something, I would have to change it inside both views. Is there a more convenient way?
Thank you!
We're building an iOS app which partly makes use of UIWebViews to render some UI elements. I noticed, that colors which are defined on the Storyboard are rendered differently than colors with the same values in the Web View. The following screenshot shows three example colors on the storyboard and in the emulator: #00C2F0, #00843C and #FF008F.
The left squares show each color rendered as CSS background-color within a UIWebView, the right square shows the color assigned as background to a UIView directly through Interface Builder.
When I take a screenshot and measure the color values in Photoshop, the color shown within the UIWebView is exactly as defined (i.e. exactly matching the hex color values given above), whereas the color shown through the UIView is shifted.
I've read several posts about "wrong" colors on iOS, which explain this "issue" due to color management with the goal to have a consistent visual appearance on all devices (e.g. here or here). While this sounds totally reasonable, it does not explain the inconsistent rendering through different controls.
Is there anything I can do to achieve matching colors between iOS native views and colors rendered within a UIWebView?
I finally solved my issue: The reason was not UIWebView-specific as I had originally assumed, but caused by the fact, that the colors assigned through Interface Builder were in sRGB color space. Changing to "Generic RGB" and then re-assigning the hex color values solved my issue.
Very helpful was this question and answer (I feel the duplicate flag is unjustified).
How can I create a button in a Today widget like the "edit button" in the picture below?
Is there a quick and standard way to do this or must I subclass a button and override it's draw method to draw a filled and rounded rectangle with transparency and background-only highlighting when touched down?
I am trying to find the best way to create exactly the same visuals for a button, instead of trying to imitate and match behaviour of it. Is it possible?
Segmented controls are a default within Xcode. It does most of the heavy lifting for you.
The UIKit Interfact Catalog in the iOS developer library should be helpful for you.
Within Xcode:
You will find segmented controls within the Interface Builder, in the Segmented Control section of the Attributes Inspector.
From here you can begin to build the visual styling and tie it to your code.
This should point you in the right direction.
More from apple is here: Segmented Control in the iOS developer library
They have great documentation, be sure you always seek that out.
From some quick tinkering I've got a UIButton that looks relatively close, you can tinker it some more to get it perfect. Here's a picture:
My buttons settings (the top one) has a height of 28, corner radius of 3, font color of black, and a background color of white with 31% Opacity. In the picture I was using text size of 15 but 13 or 14 looks a lot more accurate. I used the answers on this question as a reference point on how to create the rounded buttons.
Hope this helps some!
I'm wondering what would be the best way to desaturate a UIView—particularly, a UISliderView with custom appearance applied to it. In iOS 7, the standard controls fade out their tint colors when another view appears over them (for example, a share sheet or UIAlertView), but since mine is built from UIImages, the tint property doesn't apply to it, and they remain saturated.
Is there a good, easy way to desaturate this, short of re-applying a new UIAppearance for it? (If I were to go that route, would I even be able to animate the transition from colored images to greyscale ones?)
Thanks in advance!