0

I want to display some hint to user when a user touches the button in iPhone native application, just like tooltip in web applications.

I have a large number of TextField that should be associated with info button to let the user know the detail description about the data captured in that TextField.

Can any one post steps to achieve this?

2 Answers2

1

Agreed with Justin, but if you really had to:

  1. Add an action to the UIButton that launches on the Touch Down event, e.g. UIButton * button = [[UIButton alloc] init]; [button addTarget:self action:@selector(doSomething:) forControlEvents:UIControlEventTouchDown];

  2. Define the 'doSomething' action method as showing a custom 'tooltip' view anchored to the button location. The UIButton which was touched will be passed to the action method, from which you can access its location and so know where to anchor the tooltip.

If this all sounds laborious, check out "Is it possible to show a tooltip in an iOS app?", which links to CMPopTipView (https://github.com/chrismiles/CMPopTipView#readme), a useful package which will do it all for you. Haven't used it myself, though.

Community
  • 1
  • 1
beaudrykock
  • 248
  • 2
  • 17
0

I'm not sure how to achieve this, but it sounds like a terrible User Interface idea for a mobile app.

I say that because tooltips in classic applications typically happen on mouse hover. Mobile interfaces don't have an equivalent gesture. When you touch a button, it's like a click.

If you look at most mobile applications that need to explain something to the user, it's usually done through visual elements that show up when the app loads (they'll point to different buttons, explain what they're for, and then go away after the first time the button is used).

Justin Niessner
  • 242,243
  • 40
  • 408
  • 536