Re: How to create a dial keypad with autolayout?
Re: How to create a dial keypad with autolayout?
- Subject: Re: How to create a dial keypad with autolayout?
- From: Robert Vojta <email@hidden>
- Date: Sat, 31 Aug 2013 21:27:44 +0200
Hi Steve,
I had some free time, so, I made sample project for you ... (Xcode5 & iOS 7
SDK ...). You can get it here: http://d.pr/f/VOX4
Look at two classes:
DPDialPadButton & - (id)initWithNumber:(NSString *)number label:(NSString
*)label;
DPDialPadView & - (void)setupDialPadButtons;
You can run this sample project on iPhone 4 or iPhone 5. There's no device
check in this sample project, because everything relates to the parent view
size. So, it does work on both iPhones. Basically in a view with any size
(if it's not too small).
HTH,
Robert
On Sat, Aug 31, 2013 at 5:59 PM, Steve Mykytyn <email@hidden> wrote:
> Having done this a number of times with springs and struts, I thought a
> telephone dial keypad would be a good way to learn the ins and outs of auto
> layout
>
> - 5 rows of three buttons each
> - Each button has a label (2) and optional label below (abc)
> - The width of the buttons always the same.
> - The height of each button changes between 3.5 and 4 inch iPhones
>
> Seems like this should be a straightforward use of auto layout, but I can't
> seem to get to a solution that does not have a very large number of
> constraints, which are very finicky if you try to adjust them.
>
> It's also very difficult to start with a row of three buttons, say, get
> that right, then duplicate that row and add/fix up constraints?
>
> Suggestions please?
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden