I add buttons on scrollview but buttons are not working - iphone

I am new in iphone.I added 10 buttons on the scrollview.Buttons are scroll properly,but only 5 buttons are working last five buttons are not working.please suggest me what i do next.

It sounds like it could be one of two things
Either ...
There are no associated actions with the buttons (programatically or in IB)
There is another view that is covering the buttons and taking all the touch events
Try swapping the position of two of the buttons (one working and one not) and see if they continue to work as before. If they do, then it looks like the actions are not set up. If they have now changed, then there is an issue with where the buttons are placed.

I also have faced such problems...I also think there will be another view which is covering that button and their touch events....

Related

Sliding fingers through view to read out individual components - Swift

I have a bunch of UIButtons scattered throughout a view controller. I want to be able to have users slide their fingers on the screen and have them read a button whenever they hover over one. I would also need it to work with VoiceOver. Is this possible? If so, how?

AddTapGesture not working for certain imageViews but not others

I am using the interface editor to add tap gestures. I have a grid of 9 imageViews which are currently occupied by placeholders but upon touching, an imagePicker will trigger and the placeholders will replaced by actual images. I have a very infuriating bug that I've been mulling over for a few hours and can't figure out. My bottom 6 imageviews- the tap gestures seem to work. But for some reason, the top 3 imageviews don't respond to the taps. The weird thing is that if I tap outside of the circular placeholder and in the larger imageview that the placeholder is contained, it works. Any thoughts? I've made sure every grid is userinteractionenabled as well, and even tried deleting the buggy imageviews and creating new ones.
You can check the issue with layers in runtime. You can find out which layers are in above of UIImageView.
When you run the app and then select The Debug View Hierarchy tab at bottom of Xcode screen above of consol tab.

How to control the number of simultaneous touches on a view in iOS

I have a UIView which contains almost 10 buttons which performs different actions. The user will be able to touch or tap on any button to perform a required action. But, i am getting a problem when the user presses multiple buttons at the same time. When two buttons are pressed at the same time(simultaneously) two actions are getting performed. Some times the app is getting crashed. So, i dont want the user to tap multiple buttons simultaneously. Is there any way in which i can ask a view to recognize only single touch instead of multiple touches or at least can i increase the time gap between multiple touch gestures...
Use button.exclusiveTouch = YES; on each of your buttons. You will need to hook them up to UIButtons and set the property in viewDidLoad for example
This is a similar post, which has a nice solution. You essentially just hook up all the buttons to the same method, and have a switch statement. Hope that Helps!
Try yourView.multipleTouchEnabled = NO;
"yourView" here is the view contents all of your buttons.

How to change UIActionSheet view?

As I observed that UIActionSheet is always appearing from down side in iPhone,
but in some app, as I saw in AlarmClock, then two button became visible, one from upside and second from downside of iPhone,
What is that exactly, I can't understand, as far as I feel, it looks UIActionSheet,
I want such appearance for one of my app....
Help!
Yes just like Ole said, you can't customize UIActionSheet . But since it is just a simple subview you can create your personal "action sheet" by subviewing and animating. So if you want a button to appear on the top and one on the button, then create two UIViews resize them to the right size for your button, add your action sheet style background or any other background, add your button, connect your IBActions to the buttons and your IBOutlets to the views. Then when you want the buttons to appear animate them onto the screen (using sone CGRect, animation time and finally [UIView commitAnimations])
Probably just one or two custom views with a custom animation. UIActionSheet is not customizable so if you want something else than the default behavior you have to write it yourself. It's not that difficult.

Can my custom tabbar be created like so for iPhone?

I have designed a custom tabbar and the developer says the design I created can't be done.
The screen is made up of a usual background with a tabbar. I'd like my tabbar to look a little different to the usual iPhone style. I would like at the bottom of the tabbar a grass illustration (transparent) and on top would sit all the separate buttons and on top of those would be the icons. All of these images (as seen in link below) are separate .png files.
When the user scrolls the content, it will scroll under the transparent grass. The buttons of course will be clickable and have a different view for an active state.
Please see the link below to see a mock-up of the image:
http://www.stuartkidd.com/dummy.jpg
I'd appreciate if the community could explain to me if this could be done and if so, how. I thought it would have something to do with 'creating a custom tabbar'.
And a further question, if it can be done, can also the tab buttons be horizontally
scrollable with a swipe action?
Thanks,
It all can be done but you are going against the Iphone UI guidelines. You won't be able to leverage the UITabbarView to do what you want so you'll basically have to write the whole thing from scratch. Your tab bar would be a scroll view with a row of buttons representing each tab. When a button is clicked you load in the appropriate view. The UITabBar controller gives you a lot of functionality for free and I suspect once you start working towards this you'll see exactly how much extra work this will end up costing you. Going against the way Apple does things can be a slippery slope.
Another idea might be to keep a hidden UITabBar to manage the tabs and call it from your custom tab bar. This would free you from a lot of the hassle of swapping views/controllers in and out.
You can create a row of custom buttons and have 2 subviews. One for the bottom navigation bar and one for the content view where you will be swapping your content based on what is pressed.
You can have a state which maintains what was clicked. Based on that you can set the button enabled state for every button in your bottom bar.
button.selected = YES
It will be easy to handle the touch up inside events and properly load appropriate views in and out of the bigger subview as they will be part of the same view controller.
I have implemented a similar functionality and it works well but still in process of submitting it to the app-store.