I'm working with a situation similar to the screenshot below (taken from another question asked about the gap at the top) .
I know how to make the UISearchDisplayController's tableView show up in whatever frame someone wanted, and that's great, but now I'm dealing with this black translucent overlay that I cannot get to move.
No amount of changing any frame for a tableView in any order is fixing it. The only thing that fixes it is changing EdgesForExtendedLayout property for the parent controller, and this is not an option given the way everything else on the page and application is displayed.
So, how can I remove or shift the translucent overlay to whatever Y position I want?
Related
I have my swift 5 app working and I'm now adding a 'tool tips' feature, explaining what each part of the screen does.
The approach I have taken is from an article online - add a subview of grey to dim the background, then to that, add a subview of the item being described again, so it is now highlighted, then also, add a subview of an explainer bubble to explain the item highlighted.
This works fine, so long as the UIView I'm using isn't from a UIBarButtonItem. When it is, the bar buttons underneath the grey screen move around to accomodate what they believe is another bar button being added, which causes everything to miss-align. Other buttons do not have this problem, only UIBarButtons.
Any advice is greatly appreciated. Thanks.
Are you adding the duplicate subview to the bar itself? It'd probably be better to add it to the screen rather than the bar so it doesn't affect the bar's layout. In order to get its frame relative to the view controller so you can display your duplicate in the correct position, you could use:
barButtonItem.convert(barButtonItem.bounds, to: self.view)
Assuming self is a UIViewController.
I have a view controller with Large Titles and I want to add a background image to it so it takes up the whole navigation bar.
Does anyone know the best way to do this. I've search all over the internet but yet to find any good examples.
Thank you
Goal is to look like this view from starbucks app.
I have checked the image. I think the best way is to add an image view at top. Then on that image view place two buttons with appropriate constraints. Then underneath that image view, add the tableview. Then in the table view cell, at first index you can add the textview, if it is a large text and underneath cells will cover all the things your require with labels in the left and the > image in the right which will lead to a different screen.
I ran into a similar problem just like this and I didn't find any solution over the internet neither. But I do have a simple work around that might be helpful.
What I did is setting the image as navigation bar's background and also add the image to the view in the VC. Make sure the navigation bar has no shadow and its translucent property is set to NO.
I have a UITabBarController like this:
As you can see, the 'Discover' and 'Requests' titles are compressed by high amounts of kerning. They are also slightly clipped at the end of each item title. Is there any way to fix this?
P.S. The problem does not appear on iPhone 6 and 6+, only 5S and below.
It seems like there is an issue with UITabBars where, if they deem their frame too small, they'll attempt to kern the item title labels to fit.
This issue with frame size can happen either from manually setting the frame of the UITabBar or possibly by having a larger number of items than will comfortably fit on screen (in your case 5).
In my experience with this issue, someone had erroneously set the frame of the UITabBar to CGRectZero so that, while hidden, it wouldn't effect layout geometry for a UIToolbar. Might you be manually editing the frame of one of the two tab bars you have?
I had this issue happen when I was trying to add a UITabBarController too soon. I was adding it as a child view controller of the main window.rootViewController in its viewDidLoad: method. However, the root view has not been properly initialized at this point yet, so the tab bar was using incorrect frame for calculations (as Ben Lachman alluded to). I solved it by adding a delay to initialize the images on the tab bar items, which in turn made the titles display with correct spacing.
I've got a map view, as a subview within a semi complex view hierarchy. Everything works fine, except that the accuracy circle, pulsing wave causes the underlying map view to bleed onto both the navigation bar, and the tab bar whenever the blue, user location pin is near either one. I've got all the parent views' clip subviews set, so wondering what else might be the problem. The view hierarchy is window/scrollview/content/mapview. Thanks.
Update:
I've since tried rearranging the view hierarchy to test various layouts, and confirmed that all the parent views have clipsToBounds = YES and still getting the bleed whenever the "pulse" occurs. Odd things is that the only two views affected by this are the nav bar, and the tab bar. The undesired behavior is that when the pulse ring expands, near either the tab bar or nav bar, the underlying map view begins to draw under the area within those views where the pulse intersects them; as if they are being wiped away and exposing the map view underneath it
Thought I'd share some recent info on this, in case somebody else happens to hit this same issue.
In my case, I had to set the parent view of the mkmapview (content view) clipsToBounds property NO, and everything worked. It seems counter intuitive, I know, but it's the solution an iOS support engineer proposed. Technically, it's not a supported configuration, but the tech engineer also indicated that it shouldn't bleed like that anyway. I filed a bug for it, as he suggested. The only downside to this is that I had to let go of rounding corners and drop shadow; can't get that without clipsToBounds=YES.
Since i have a complex hierarchy of views i handle the rotation manually with CGAffineTransformMakeRotation.
Everything rotates in harmony, status bars, navigation bar etc. The only problem is, if the keyboard was on screen before rotation, it gets the orientation of the satiates bar but its size is not right.
How can i force it to fill the entire width and get the right height?
I tested with a single test UIview and it looks likes this.
http://dl.dropbox.com/u/15251533/iPhoneSimulatorScreenshot_20120430_133558.png
I found a simple approach to get rid of this situation.
If you call resignFirstResponder on the Textfield and afterwards becomefirstresdonder consequently.The keyboard appears in the right position after rotation.It also does not disturb the animation if you have one.