开发者

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?


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


  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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜