swift login form not corresponding with background - ios

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.

Related

Limit AutoresizingMask height stretch

I made this screen
Screen on iPhone 4s(9.3)
It looks fine on that device, however when i test this same screen with iPhone6(9.3) it looks like this. Since i cannot post more than 2 links, i merged the third image with the second one
Screen on iPhone 6(9.3) with the Third Image
As you can see, that gray view, doesn't fill the white space beetwen that same gray view and the first bottom button(lojas). Notice that i don't have the autoresizing height stretch on(that vertical arrow inside the blocks). If i turn that on, this happens
Third Image inside the Second Image
See that, the gray view goes over the buttons, i don't want that.
My question is, how can i solve this? Is there a way to make the gray view stop above the Lojas Buttom at the bottom? Thanks for your time!
OBS: I CANNOT use autolayout.
EDIT: Got the problem solved
I just changed the View as option in Interface Builder, changed it to 7.0 and later, so it gave me the "real appareance" of the app.
I changed the View as option inside the Interface Builder so i could see how the app really look like and set the iOS Deltas to 0, made the changes based on that.

iOS Swift Add Image to Navigation Bar in Centre While Keeping Aspect Ratio

I've been looking for a solution for this for more time than I'd care to admit. I've managed to add a background image, although this then skews the image so it isn't right.
I'm looking for how to add an image to a NavigationBar in the centre? I want to add a centre aligned logo to the top screen.
This particular section of the app is contained within a Navigation Controller which pops up as a modal for Logging In before the user can go any further. Once logged in then the remaining parts of the app will likely be contained within a Tab Bar Controller. Not sure if this makes any difference when trying to add a logo, so mentioning just in case.
The documentation on everything Swift related from Apple is abysmal.
Regards,
Michael

White area in UITableViewCells iOS

What could possibly be causing this white area to show on my iPad simulator?
this is just a snippet of the table view and ONLY shows like this on the iPad. I've seen this before on my actual iPad app but only when the user selects the row it would highlight that weird white rectangle.
I'm about ready to submit a new build but afraid this will show like this on an actual iPad.. Anyone else seen this before?
Here's how my storyboard is set up:
And my folder/view hierarchy:
I realize I have a lot of views within views but I've never had this behavior before and the weird thing is i don't have any views that have the same dimensions as the mysterious white area..
Fixed it by making the tableView background color and the cell background color clear.

UIButton is out of navigation bar

I have a custom UI Button (just regular button but with image), within the navigation bar, but when I choose my image it looks like this in designer:
As you can see here, it's over my provider and status labels, and also when I run application it's over the WebView (which is bellow), so definitely out of navigation bar. I tried to find in storyboard some property where I can adjust this but I couldn't find any. I'm using swift and storyboards.
Appreciate any help, iOS newbie :)
Based on your description I think your issue is that you are trying to add a button for navigation. What you need is a NavigationBar with a NavigationItem/BarButtonItem in it. If you look in the object library you will be able to find these.
Just drag them onto your story board. Once there select the button and in the side menu you will be able to select the Image for that Item. Now it is in the navigation bar up top. Let me know if there are still issues. 👱🏼
You have to make sure your 1x image is to the specified size (and then your 2x etc, or just use a PDF at the 1x size.
Icon sizes are here: iOS Human Interface Guidelines: Icon and Image Sizes
I made my pdf 22x22 and added it to .xcassets with scale factor "single vector"

Simple Horizontal Button Bar for iOS

I have a requirement for a very simple Button Bar.
It should take up the width of the screen.
It should allow at least 3
buttons.
The buttons should be of equal width and together take up
the whole width of the bar.
Each button should be tappable, but not
have a selected state.
The bar will be overlaid on a MapView and positioned directly above a TabBar.
Tapping a button will launch a Modal ViewController.
I thought about using a UITabBar and not allowing its tabs to become selected, but the HIG is pretty clear that this is not correct usage and UIToolBar doesn't allow the button widths to be set.
This seems like a very simple requirement but I can't see an obvious solution. Is there something I'm missing? Can anyone suggest a solution?
What's wrong with just creating a simple view that draws an appropriate gradient, and then adding three buttons of the appropriate size?
If you're feeling ambitious, or if this is something that you're likely to use more than once, you could even have the view create the three buttons. Call it ThreeButtonBar or something. Give it a constant height and adjust the width to match that of its superview so that you can use it in portrait or landscape orientation.

Resources