I want to impliment a clickable pie chart in iphone app. I have an image for this but i want to know how can i specify clickable areas using UIImageView or any 开发者_如何学Cother component. I don't want to use HTML image map.
A simple solution could be to add transparent buttons on top of your image.
UIButton *transparantButton = [UIButton buttonWithType:UIButtonTypeCustom];
transparantButton.frame = CGRectMake(100, 100, 50, 50);
[transparantButton addTarget:self action:@selector(clicked) forControlEvents:UIControlEventTouchUpInside];
[imageView addSubview:transparantButton];
You can probable try by placing custom buttons over the areas you want or detect touch and based on the location of touch u can perform necessary actions.
Note: The method using buttons is better if the number of such clickable regions is small.
you can create image map for iphone using jquery mobilymap: Jquery Map
精彩评论