-2

I'm new to iPhone. currently i m working on an application in which,i have to add an image to a button. i made the image with transparent background but it is showing white area instead of being transparent. how come it would be shown as transparent. I am creating the button through -(IBAction).

help is appreciated.

DD_
  • 7,230
  • 11
  • 38
  • 59
viveka
  • 1
  • 1
  • 1
  • you must define button as custom and not round – Simone Pistecchia Feb 21 '13 at 09:11
  • We know your are new to StackOverflow but kindly do some search on google, you will get tons of answers having EXACT answer to your Question. You will be downvoted by others as some one has already did it. :) – mAc Feb 21 '13 at 09:12

2 Answers2

4

First of all you need to add png image into your project which you want to add as button image. Then choose button > go to interface builder > choose Type as 'Custom'

select appropriate image from Image/Background option

Hope it helps you.

iRoid Solutions
  • 415
  • 6
  • 20
0

Its very easy Viveka :- Follow these Steps

1) Create an IBAction for Button and link it with the element mentioned in your.h File. 2) go the xib of your viewController and select the button and go to the Attribute Inspector (4th from Left). 3) go to the Type property of it and set it to Custom instead of RoundRectButton.

NOTE :- If your Image is Transparent then you dont have to do anything extra for making it transparent

If you are facing any problem plz revert, i would love to help it.

mAc
  • 2,434
  • 2
  • 22
  • 39