Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-10-2012, 03:11 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2011
Posts: 74
deeptika is on a distinguished road
Default Custom button

Hi,

How to create custom button based on text size.I have three images they are left,right and center strip image . I have to create an button by join three images when the text size can be increased then the button can be created based on that size.Please any body help me to find the solution i have tried for two days but still i didn't get any solution.Please somebody help me to solve this problem.
deeptika is offline   Reply With Quote
Old 02-10-2012, 03:45 AM   #2 (permalink)
New User
 
Join Date: Nov 2011
Location: Spain
Posts: 8
gmarro is on a distinguished road
Default

Quote:
Originally Posted by deeptika View Post
Hi,

How to create custom button based on text size.I have three images they are left,right and center strip image . I have to create an button by join three images when the text size can be increased then the button can be created based on that size.Please any body help me to find the solution i have tried for two days but still i didn't get any solution.Please somebody help me to solve this problem.
Some methods can be used. As I understand that you want a button whose image is a combination of three other images, you can follow these next steps:
1. Build a view with the final size you want and add the three images as image views on it. Of course, each one with its well calculated frame.
2. Get the image from the view with this code:
Code:
UIGraphicsBeginImageContext(myViewWith3Images.bounds.size); 
                

[pictureView.layer renderInContext:UIGraphicsGetCurrentContext()]; 

UIImage *buttonImage = UIGraphicsGetImageFromCurrentImageContext();
3. Create the button and set the image.

You can also use stretchable images as you know. But as you say you have to use three images I suppose that is not a solution for you.
gmarro is online now   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 390
12 members and 378 guests
chiataytuday, chits12345, ChrisYates, fiftysixty, fredidf, gmarro, KennyChong, kilobytedump, Leslie80, Meoz, ryantcb, Yosh_K
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,670
Threads: 94,121
Posts: 402,903
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Yosh_K
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:28 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0