Lakshminarayana
Lakshminarayana

Reputation: 1

how to place .jpg file in .xib file?

In my current application,I have to design a login page.which contains username and password textfields.but my requirement is to insert image(instead of submit button).can anyone give a clear idea about this task?

Upvotes: 0

Views: 179

Answers (2)

Matthew Frederick
Matthew Frederick

Reputation: 22305

  1. Make sure that the jpg is imported into your project in Xcode.

  2. Launch Interface Builder with your .xib.

  3. Create the UIButton. Click on it and press Cmd-1 to show the button's Attributes.

  4. Change the button Type to Custom.

  5. Click on the Image element in the palette and choose the jpg image you want to use,
    OR
    If you prefer to have text over the image, instead change the Background element to your image.

Upvotes: 0

Tejaswi Yerukalapudi
Tejaswi Yerukalapudi

Reputation: 9157

You need to use a UIImage instead of a UIButton. Instructions here - http://iphonesdkpro.com/iOS+SDK+Using+a+UIImage+as+a+Button+iPhone+SDK

Upvotes: 1

Related Questions