开发者

Image maps in iPhone app

开发者 https://www.devze.com 2023-02-15 19:46 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消