1

I am creating a pie chart in which each section is a separate button with background image and denotes an individual method, but uibutton has a rectangular shape and all the buttons overlap.

I want to select a section(button) (i.e the button shape should be the image's shape not the default rectangular button) without disturbing the adjacent sections(buttons)...

eg: consider an pie chart with 8 sectors denoted by 8 buttons from 1 to 8,the buttons have background images of sectored shape,if a user taps anywhere on 1st sector(button) then any other sector(button) should not be clicked...

Asciiom
  • 9,867
  • 7
  • 38
  • 57
A_Thorne
  • 141
  • 1
  • 12

2 Answers2

0

Add a UITapGestureRecognizer to the whole pie chart.

Get the coordinates of the tap within the chart, and use mathematics to determine which slice the tap is on.

Minthos
  • 900
  • 4
  • 13
0

if your using in interface builder,Just change your button type into custom and assign yur image to the button.in coding just assign a customised button

fazil
  • 57
  • 1
  • 8