i image does not work good in utility app on iPhone app - iphone

I working on a utility app. When I run the app in simulator clicking i image at the bottom flips the view in a flash. But when I run the app on iPhone device it behaves abnormally. At times it flips the view in just 1 tap. The other times it does not bother to react even after tapping the image 10 times. I tried with other utility app also - same issue. Thus its not an issue with the code I believe.
Any help to resolve this issue is much appreciated.
Thanks,
AJ

This is a problem because the 'i' button is not very big by default and touches are missed easily.
You need to put another button in front of the 'i' button with the 'Custom' type in Interface Builder, so that it doesn't have any image. Then you can make this invisible button much larger and connect it to the same action as the info button.
You also need to enable "shows touch on highlight" in Interface Builder so that you get the white glow effect when the invisible button is touched.

Related

Implement the Flash button animation as in iPhone camera in my app?

Im developing a camera app, I want to implement the same animation that happens in default iPhone camera app when you click on the flash button, i.e once you click on the flash button, we can see the other 2 buttons animating, and once you click any one button it again animates and hides.
how can i do this?
Thanks in advance.
Take a look at DDExpandableButton which is able to do exactly this and even includes example code for creating a flash button. https://github.com/ddebin/DDExpandableButton

No button events in iphone 5 simulator

When I test my app running in the iPhone 6 simulator everything works as expected. If I however test it in the iPhone 5 or iPhone 5.1 simulators, I can't seem to get button events fired. Im using Xcode 4.5.2, not using storyboards and I have made tests with simple buttons with actions like:
- (IBAction)test:(id)sender {
NSLog(#"YEES");
}
And the actions is connected using drag and drop in the interface builder. I just can't seem to get it fired.. Do you have any idea about what could be the problem?
Update Jan 18:
If I do a "normal" click on a button in the iPhone 5/5.1 simulator nothing happens. If I do a bit "slow" click on a button the button will be "pressed"/selected. If I do a "really slow" click, like holding the button down for 3 seconds I get the button click event! How is this possible??
I found a solution for my case - i added UITapGestureRecognizer to the container UIView, and it intercepts events before UIButtons, and need some time to fail before buttons can handle tap... But it strange that in iOS 6 all works fine
To avoid this we can simply call:
[tapRecognizer setCancelsTouchesInView:NO];
I really suspect this could be the issue of view overlapping.
Please color your views that you are using on the view controllers and check whether any of your view is overlapping your button or not
I had a similar issue with an iPhone 5s simulator. Through trial and error I realized that the button's height in the simulator was 0 or otherwise a small number... The first clue to that was that when I changed its background color - the background did not show in the simulator (on larger simulators, like 6 or 6 plus, it showed as a thin line instead of full height). Then when I added a height constraint, it started accepting click events. That helped me identify the issue, but it was not the solution I was looking for. Initially I laid the button out without size constraints, so it's actual size should have been determined by it's intrinsic size. So instead of the height constraint, I changed the vertical compression resistance of the button to "required". That fixed the issue.

My button doesn't detect touch events on iPhone (Retina 4-inch) simulator, but works in iPhone (Retina 3.5-inch) simulator

I'm getting my app ready for the iPhone 5 using the simulator and I've found a weird issue where a couple of my buttons, in one of my views, don't work in the iPhone (Retina 4-inch) simulator, but work fine in the iPhone (Retina 3.5-inch) simulator. The buttons simply don't do anything when they're tapped. Has anyone else experienced this issue?
I having a difficult time figuring out where to start with this one. Any suggestions on where to start?
Thanks so much in advance for all your wisdom!
You need to edit your MainWindow.xib and enable "Full Screen at Launch". For a more detailed explanation, see Apple's docs:
Important: When creating your window in Interface Builder, it is
recommended that you enable the Full Screen at Launch option in the
attributes inspector. If this option is not enabled and your window is
smaller than the screen of the target device, touch events will not be
received by some of your views. This is because windows (like all
views) do not receive touch events outside of their bounds rectangle.
Because views are not clipped to the window’s bounds by default, the
views still appear visible but events do not reach them. Enabling the
Full Screen at Launch option ensures that the window is sized
appropriately for the current screen.
Complete document from Apple
For me, the solution was to set the size ("Simulated Metrics") to "Retina 4 Full Screen" for the MainWindow.xib. I did not need to alter the size of the other screens (they are still set to None). After changing the MainWindow.xib the bottom area becomes clickable again...
The problem was caused by another control overlapping my buttons due to the way the springs and struts were setup. Adjusting the z-order of the buttons fixed the issue. Thanks, all!
There are two solution to this problem :
If you are using MainWindow follow these steps :
a. Select MainWindow.xib.
b. Select Full Screen at Launch from Windows option available in Attributes Inspector.
If your application doesn't contain MainWindow then just add:
self.view.frame = [UIScreen mainScreen].bounds
in ViewDidLoad.
I solved my prob.
view .origin for 3.5 inch and 4 inch screen are different so, when writing common code for both we need to take care at giving CGRectmake(x,y,w,h);
Set temp. diff background color of diff view so you can check if any view is overlapping or not, to fetch event in 4.0 inch.

In simulator, app is blank (white), but appears normal when quit?

So I'm new to programming but I'm managed to create the groundwork for an iPhone app.
Problem is, when I run it on the iPhone simulator, it first shows up as a white/blank screen (with the status bar at the top) until I hit the home button. When it is doing the minimization animation (~0.5 second) the app will display correctly.
I know that an issue with versions could be the cause of this but I'd need to buy a newer Mac to upgrade to the latest version of Xcode. If there are other issues that could be causing this I'd love to know
thanks :)
Add Default.png image to your application and see if it shows that during loading. Run the app in debugger and add a breakpoint to viewDidAppear in your viewController. It's probably running but not loading in the view you are expecting it to for some reason.
To some viewcontroller's view your are not setting the background color as clear color .. that's why it is showing blank white screen when your application is launching .. if your are using xib .. set the background color of that view to clear color using interface builder.

Tap to focus on camera apps, Supposedly not possible, but a bug in my app enables it (although useless)

I would like to get tap to focus in my app and the controls are hidden
Supposedly this is impossible but I know its not. I have a simple iAD dragged into an overlay, no code or anything. When I click on the iAD nothing. but when I close it with the home button I get a modal exit of the nonexistant iAD and the camera apps relaunches but in the top left with only a small portion viewable. But this time the tap to focus is enabled.
So how can I do this without the bug?
Thanks!
Guess no one got it? I just showed the controls to take a snap and zoom and focus came up!