The Area shown below of a UIButton is not registering touchsBegun but registering when touchesEnded ( which is calling also touchsBegun). In addition, the highlight state is not working in this area (again it works only on release but less evident). I have checked also the debug hierarchy but do not see anything strange (I am new to x-code and swift :)). The other part is working as expected. The button to the right works as expected
hierarchy view 1
hierarchy view 2 with tree view
The problem is the navigation bar. Hiding it has solved the issue. It appears that the navigation bar takes a few pixels from the left of the screen to enable back navigation with a swipe; this was covering the button.
Related
I am at a loss with what is potentially a simple fix.
I have a basic ViewController with a UINavigationController, and a UISearchBar embedded.
Basic view layout
When I PUSH a new UIViewController onto the Nav - I get a brief animation issue where a black background appears, and also the cancel button doesn't disappear.
Animation glitch
It's only brief, but annoying enough.
When I return back using the back button, the search bar reverts to white, and then switches to red.
Back display issue
I wondered if I had configured something wrong, so I created a fresh project and left everything with the defaults. Yet I get the same issue.
Stripped back and the same issue
I'm using xCode 9.3 - with swift 4.1
Any ideas?
Check the extendedLayout settings of your view controllers (these can be set in code or in the storyboard editor). They need to be the same for both view controllers or you'll get this animation glitch.
In your case the problem might be the embedded search bar. It seems to be present only for one of the view controllers. You've got navigation bars with two different heights because of that. The framework doesn't respond well to that...
I have a view controller that is composed of a web view and a toolbar with some basic controls. The toolbar is pinned to the bottom of the screen using auto layout. It has four constraints, to pin it to the left side of the screen, the right side of the screen, the bottom of the screen and another that pins the bottom of the web view to the top of the toolbar.
I am having too issues with this. The first is that the web view when loading a URL has a black bar running across the bottom of the screen for a second or two while the page loads, see attached screen shot. This occurs on both iOS7 & iOS8.
[EDIT]
This bug and the one below are related I think. I just discovered that the horizontal indicator when scrolling displays not at the bottom of the screen but higher up, where it would appear if the tabbar where present.
[/EDIT]
The second issue I am having with iOS7. The screen that calls this screen is the typical navigation bar inside a tab bar setup. The user presses a button to go to a particular page, the browser gets created and pushed onto the navigation bar stack. It hides the tab bar when created. In iOS8 this works perfectly, the toolbar is pinned to the bottom of the screen. In iOS7 the tab bar is removed but the toolbar is placed as if the tab bar was still present?! Any ideas how to fix these two issues? Many thanks.
FYI - Xcode 6.1.1
The "black bar" is most likely your app window background. At the time of loading the web view is still under the navigation bar. Perhaps the constraints are being overridden. Check your storyboard settings:
If this is it, it might solve the second issue as well.
Speculation
The reason iOS 8 works is because from Apple talks I gleaned they realise many dev had issues with their views being under the nav bars by default. Introduced with iOS 7. They likely changed this in iOS 8 but found no written evidence. If someone can confirm or deny this, I'll update the answer.
I'm aware some of you may not be familiar with Monotouch, but this could certainly be a general iOS issue rather than a specific Monotouch issue.
I'm recreating an app with similar functionality to the default mail app:
This is a simple recreation of our app. It's a UIView which contains a UITableView and a UIToolbar. It's loaded from a XIB file (which contains accompanying view controller code). This view is a UITabController view (though I'm sure this shouldnt affect things?).
This has been pushed from a navigation Controller using
controller.PushViewController(inboxItem.Controller, true);
(where inboxItem is a custom object I've made, the Controller property being the inboxItem's view controller).
Pressing the right hand button on the toolbar presents a new modal view (compose new message) - which does its thing and no matter which way its dismissed, upon dismissal, the UIToolbar disappears. However, if I am to click on another tab then click back onto this tab, the Toolbar reappears. Is this a redraw issue?
Am I doing something wrong with the way I'm structuring my app? Or have I happened to stumble across some bizarre iOS/Monotouch bug? (I'm hoping it's for the former - so I can improve my iOS development).
I solved the problem. Basically, what was happening was when the ModalView was being presented and then dismissed, the toolBar was being moved down by 44 pixels each time.
In my example, the toolBar is placed above a UITabBar, so when the modal view was dismissed the toolbar was being moved out of view. I'm not sure why this is happening but I'll be sure to file appropriate bug reports.
One quick and (very) dirty way around this is to move the toolBar up 44 pixels when displaying the modalview, so that when it is dismissed, it will move it back down to the appropriate position.
I am trying to set up a Modal View Controller, that that lies below a fixed toolbar. therefore the toolbar is supposed to stay on top while the modal view rolls in.
the Safari-App does that for example, when hitting the bookmarks-button. the toolbar stays, the buttons change..
I tried a couple of things like pushing the toolbar to the front and ended up not using the presentModalViewController method at all, and animating the new View manually into a subview instead. but that brought a couple of other issues along.
I'm not sure what you are saying, when you press add bookmark in safari, a new modal view shows with no tool bar. The navigation bar at the top is not a tool bar if that is what you mean. They are UIToolbarItem set into self.navigationItem.
All modal views I've seen are animated until they take up the whole of the screen. Those modal-like views that only scroll up to a certain point in some apps, are done by hand. Maybe you can cover those issues encountered when doing this by hand in another post?
While in a call, if the user wants to use my application, and if the call finishes, and the user is still in the application, the toolbar moves up, well all the view moves up, and so the toolbar now has a space in the bottom. Basically the height "Touch to return to call" has. I am using a toolbar and a navigation controller. The navigation controller moves fine, and everything in the view moves accordingly, the only problem is with the toolbar. So the question is, Is there an event, which is called after the call is finished, so I can set the frame again of my toolbar? I tried this delegate with no luck:
- (void)application:(UIApplication *)application willChangeStatusBarFrame:(CGRect)newStatusBarFrame
This one is called only when the toolbar is changing orientation.
alt text http://is.hn/downloads/IMG_0008.PNG
alt text http://is.hn/downloads/IMG_0009.PNG
Thanks.
In general setting your auto resize masks properly should fix things. Could you update with a screenshot to show exactly where the resizing issues are happening?