Can someone tell me the pixel height of the iPhone navBar, when you turn the phone Horizontal?
I know this is a basic question but I cannot locate the answer.
Thank You.
You shouldn't rely on hard coded values when dealing with UI sizing. Especially now that the [large-iPod-type-device] is on it's way.
You can get the height of the bar by querying its frame.
something along the lines of:
navigationController.navigationBar.frame.size.height;
will return the bar's height.
Related
I am very new to flutter and modern programming languages at all. At the moment I am working together with someone in order to create an app.
We are having problems with the layout of the grid and cards with different screen sizes and orientations.
Vertical Screen Screenshot
Horizontal Screen Screenshot
As you can see, the cards are messed up as soon as the screen width is too high. I don't have access to the source code right now, as the person programming it, is not available at the moment.
I read a lot about different techniques to build a card grid like that in a responsive way.
My guess the problem is, that the cards are not in containers with a fixed size. If they were, the pictures / buttons and texts inside that container would always look the same. Is that assumption correct?
Then my other idea was to use ResponsiveGridListBuilder to solve the problem that too few cards are shown in horizontal mode.
But as I said ... I am a newbie in flutter, so if any of you could make suggestions, I would be happy!
If possible, some code as an example would also help a bunch.
So far the programmer only tried different calculations of the cards in comparison to the screensize, but this didn't help as you can see.
Cheers!
I think it's better you use Wrap to fill the Row even in horizontal or vertical screens. but if i was in your shoes i would develop the items that are suitable and has const size for vertical and horizontal sizes, and let them to fill theirselves in the row depends on the width screen size that it has.
if you didn't understand what i mean i can explain it more my friend :)
happy coding...
The main problem is between switching 3.5" and 4" There are 2 pics they show exactly what my problem is.
You see at the second picture the UIImageView shrink a bit. This is not what I want. The better look is if the textView will scale down and maybe if the content is to big get scrollable.
How can i solve this? Thanks in advance.
I highly recommend you have a look at this link.
tutorial explaining autolayout.
From what i can understand from the images, you should fix the imageview's height
and edit the height of the the textview so that it have values less than of its current height
inorder to do so you can click the height constraint click the gear picture and edit it
I'm having some issues with the constraints in my app. Here is how it looks on the iPhone 4 (that's how i want it to look, and how i usually setup my interface, is this the proper approach or not?)
Now, when i switch to the iPhone 5 screen it looks like this
and as you can see, the blue dots (which is UIButtons) are not placed where i want them to be. I made my constraints rely solely on the right side of the view (since that is the one re-sizing, i found that in order for you'r views to align themselves accordingly, it doesn't help to align them to the left side). I don't really know how to fix this. I am finding this new iPhone screen to be a real pain in the arse. Any good advice on how to work with this new screen without a lot of headache would be appreciated :)
Thanks on advance
It looks to me like the are still the same distance from the right side of your view, as you said you set them to be, while the background has stretched to fit the new size. I suspect it's actually the background that isn't doing what you want it to do (keep the same aspect ratio and show more stuff on the left), or try keeping the buttons relating to left and right to stay aligned with the stretched background image.
I'm playing around with an iOS project in Xcode, I've created a new navigation based application, and I'm curious of something. Is it possible to add a margin around the screen, so that the navigation bar, table and toolbar have a few pixels on the top, bottom, left and right? The purpose would be for the entire view of the application to not be 100% of the width and height of the screen, maybe only 95% of each. Not sure if I'm using the right terminology, I'll try to clarify if necessary. Thanks!
Maybe I just didn't ask the question sensibly, but since I can't find an answer, I'm just going to create custom images for navigation bar and toolbar using black space for the margin, and use another question's answer in regards to shortening the width of the UITableViewCells.
I've had this issue come up a couple times doing iPhone development now and have yet to find a good solution for it. What I'm looking for is this:
I want to show some text along with an icon and I want the overall display to be centered within its parent view. Specifically, in my current case, I'm looking to display a box that says "Reconnecting..." with a UIActivityIndicatorView to the left of the text.
Previously, I've just relied on the fact that I know exactly the dimensions of the text and activity indicator, so I can position things absolutely to appear centered. What I'm looking for is something more automatic.
Any ideas?
One of the UIKit additions to NSString will return the pixel size of the text if you give it the font that you're using on the UILabel. So then presumably the total size of the two things together in the layout you describe is:
the difference between label.frame.origin.x and activityIndicatorView.frame.origin.x; plus
the width of the text.
You can then either shuffle both the views appropriately or give them a common parent that's still a subview of the whole thing and shift that.
An activity indicator can be shown in a view just calling a single method.Please click here get SHKActivityIndicator class