Adjusting the line to fit our head in imageview - iphone

I am developing one application same as HairTryOn all things are done. but problem is display in following image. i want to set hair style as per customer face using blue line as per display in image.
i used the following code
testVw = [[UIView alloc]initWithFrame:CGRectMake(100,100, 100, 100)];
testVw.backgroundColor = [UIColor clearColor];
[self.view addSubview:testVw];
resizeVw = [[UIImageView alloc]initWithFrame:CGRectMake(testVw.frame.size.width-25, testVw.frame.size.height-25, 25, 25)];
resizeVw.backgroundColor = [UIColor clearColor];
resizeVw.userInteractionEnabled = YES;
resizeVw.image = [UIImage imageNamed:#"button_02.png" ];
[testVw addSubview:resizeVw];
UIPanGestureRecognizer* panResizeGesture = [[UIPanGestureRecognizer alloc]
initWithTarget:self action:#selector(resizeTranslate:)];
[testVw addGestureRecognizer:panResizeGesture];
The resizeTranslate: method:
-(void)resizeTranslate:(UIPanGestureRecognizer *)recognizer
{
if ([recognizer state]== UIGestureRecognizerStateBegan)
{
prevPoint = [recognizer locationInView:testVw.superview];
[testVw setNeedsDisplay];
}
else if ([recognizer state] == UIGestureRecognizerStateChanged)
{
if (testVw.bounds.size.width < 20)
{
testVw.bounds = CGRectMake(testVw.bounds.origin.x, testVw.bounds.origin.y, 20,testVw.bounds.size.height);
imgvw.frame = CGRectMake(12, 12, testVw.bounds.size.width-24, testVw.bounds.size.height-27);
resizeVw.frame =CGRectMake(testVw.bounds.size.width-25, testVw.bounds.size.height-25, 25, 25);
rotateVw.frame = CGRectMake(0, testVw.bounds.size.height-25, 25, 25);
closeVw.frame = CGRectMake(0, 0, 25, 25);
}
if(testVw.bounds.size.height < 20)
{
testVw.bounds = CGRectMake(testVw.bounds.origin.x, testVw.bounds.origin.y, testVw.bounds.size.width, 20);
imgvw.frame = CGRectMake(12, 12, testVw.bounds.size.width-24, testVw.bounds.size.height-27);
resizeVw.frame =CGRectMake(testVw.bounds.size.width-25, testVw.bounds.size.height-25, 25, 25);
rotateVw.frame = CGRectMake(0, testVw.bounds.size.height-25, 25, 25);
closeVw.frame = CGRectMake(0, 0, 25, 25);
}
CGPoint point = [recognizer locationInView:testVw.superview];
float wChange = 0.0, hChange = 0.0;
wChange = (point.x - prevPoint.x); //Slow down increment
hChange = (point.y - prevPoint.y); //Slow down increment
testVw.bounds = CGRectMake(testVw.bounds.origin.x, testVw.bounds.origin.y, testVw.bounds.size.width + (wChange), testVw.bounds.size.height + (hChange));
imgvw.frame = CGRectMake(12, 12, testVw.bounds.size.width-24, testVw.bounds.size.height-27);
resizeVw.frame =CGRectMake(testVw.bounds.size.width-25, testVw.bounds.size.height-25, 25, 25);
rotateVw.frame = CGRectMake(0, testVw.bounds.size.height-25, 25, 25);
closeVw.frame = CGRectMake(0, 0, 25, 25);
prevPoint = [recognizer locationInView:testVw.superview];
[testVw setNeedsDisplay];
}
else if ([recognizer state] == UIGestureRecognizerStateEnded)
{
prevPoint = [recognizer locationInView:testVw.superview];
[testVw setNeedsDisplay];
}
}
This code Resizing full view. but i want to Resize only those part which is moved by finger.

I don't see how your primitives are constructed. But you will need to partition your point set according to touch zones and scale then as needed. If you convert your lines into Bezier curves, then manipulating the curve will be easier, as you will not need to do terrible amount of adjustment to the shape with a small modifications.

Related

Can't get UIBezierPath onto of MKMapView

I've got a MKMap, on top of this I have a little legend. The labels & images inside the legend successfully show on top of the map, but the rectangle/bezier itself doesn't show.
I've tried adding it as a subview and that fails. Is there a way around this?
I need touch to still be enabled for the map.
Thanks.
- (void) drawRect:(CGRect)rect
{
//TODO
//Hover view for touching icons
//Get rect on top of map as well
//Border on frame
//IsIpad slight larger frame/text/image
int conX = [GeneralHelper GetCenteredXPosForObj:220 :self];
int conY = 60;
//Create box
CGRect container = CGRectMake(conX, conY, 220, 50);
UIBezierPath* path = [UIBezierPath bezierPathWithRoundedRect:container cornerRadius:5.0];
[[UIColor blueColor] setFill];
[path fillWithBlendMode:kCGBlendModeNormal alpha:0.7];
//How to add to subview..?
//NZPost image 38x37
UIImageView *nzPostImageView = [[UIImageView alloc] initWithFrame:CGRectMake(conX + 20, conY+15, 25, 24)];
[nzPostImageView setImage:[UIImage imageNamed:#"icon-map-post.png"]];
[self addSubview:nzPostImageView];
//NZPost label
LegendLabel *postLabel = [[LegendLabel alloc] initWithFrame:CGRectMake(conX + 50, 78, conY, 15) ];
postLabel.text = #"NZ post";
[self addSubview: postLabel];
//Incharge image 38x38
UIImageView *inChargeImageView = [[UIImageView alloc] initWithFrame:CGRectMake(conX + 120, conY+15, 25, 24)];
[inChargeImageView setImage:[UIImage imageNamed:#"icon-map-incharge.png"]];
[self addSubview:inChargeImageView];
//Incharge label
LegendLabel *inChargeLabel = [[LegendLabel alloc] initWithFrame:CGRectMake(conX + 150, conY+18, 60, 15) ];
inChargeLabel.text = #"In charge";
[self addSubview: inChargeLabel];
}

Show multiple photos in scroller

In the app, I need to show no. of images (count- unknown) in scroller. I put all the images in scroller directly. But start receiving the memory warning level 2. Please suggest me how to do so. Is there any other way to do that?
You can also refer to following link to have better understanding of the problem.
https://www.dropbox.com/sh/h0vwnhhx1acfcb5/W2TQ638udh
-(void) getPortraitScrollReady
{
UIImageView *imageView;
NSString *imageName;
int x=0;
for (NSNumber *numberObject in tagList)
{
imageName = [[NSString alloc] initWithFormat: #"%#", [self getImage:[numberObject intValue]]];
imageView = [[UIImageView alloc ] initWithFrame: CGRectMake(x, 0, 320, 320)];
imageView.image = [self thumbWithSideOfLength:320 pathForMain:imageName]; // a function that returns an image;
[scrollPortrait addSubview:imageView];
[imageName release];
[imageView release];
x+=320;
}
scrollPortrait.contentSize = CGSizeMake(x, 320);
int pageNo =[self indexofObject:imageNo inArray:tagList];
[scrollPortrait setContentOffset:CGPointMake(pageNo*320, 0) animated:NO];
}
Keep all images in an Array/MutableArray as per convenience.
Take Scrollview, In scroll view take 5-UIImageViews to display images from array. Match the length of that UIScrollView with 5-UIImageViews.
When scrolling is done in any of the direction, then 'release' the UIImageView in opposite direction & 'allocate' a new UIImageVIew in scrolled direction.
This is what I did in my project.
.h file contents
IBOutlet UIScrollView *scrlView;
UIImageView *imgView1;
UIImageView *imgView2;
UIImageView *imgView3;
UIImageView *imgView4;
UIImageView *imgView5;
NSMutableArray *imgGallery;
NSInteger mCount;
NSInteger centerImg;
CGFloat imgFrameHeight;
CGFloat imgView1X;
CGFloat imgView2X;
CGFloat imgView3X;
CGFloat imgView4X;
CGFloat imgView5X;
CGFloat previousOffsetX;
CGFloat currentOffsetX;
.m file contents
- (void)photoGallery
{
imgGallery = [[NSMutableArray alloc] initWithCapacity:10];
[imgGallery addObject:[UIImage imageNamed:#"1.png"]];
[imgGallery addObject:[UIImage imageNamed:#"2.png"]];
[imgGallery addObject:[UIImage imageNamed:#"3.png"]];
[imgGallery addObject:[UIImage imageNamed:#"4.png"]];
[imgGallery addObject:[UIImage imageNamed:#"5.png"]];
[imgGallery addObject:[UIImage imageNamed:#"6.png"]];
[imgGallery addObject:[UIImage imageNamed:#"7.png"]];
[imgGallery addObject:[UIImage imageNamed:#"8.png"]];
[imgGallery addObject:[UIImage imageNamed:#"9.png"]];
}
- (void)photoScroller
{
CGFloat appFrameHeight = self.view.frame.size.height;
CGFloat navFrameHeight = self.navigationController.navigationBar.frame.size.height;
CGFloat tabFrameHeight = self.tabBarController.tabBar.frame.size.height;
imgFrameHeight = appFrameHeight - (navFrameHeight+tabFrameHeight);
mCount = [imgGallery count];
[scrlView setContentSize:CGSizeMake(320 * mCount, imgFrameHeight)];
CGFloat offsetX = ((320 * mCount)/2) - 160;
[scrlView setContentOffset:CGPointMake(offsetX, 0)];
imgView1 = [[UIImageView alloc] initWithFrame:CGRectMake(offsetX - (320*2), 0, 320, imgFrameHeight)];
imgView2 = [[UIImageView alloc] initWithFrame:CGRectMake(offsetX - 320, 0, 320, imgFrameHeight)];
imgView3 = [[UIImageView alloc] initWithFrame:CGRectMake(offsetX, 0, 320, imgFrameHeight)];
imgView4 = [[UIImageView alloc] initWithFrame:CGRectMake(offsetX + 320, 0, 320, imgFrameHeight)];
imgView5 = [[UIImageView alloc] initWithFrame:CGRectMake(offsetX + (320*2), 0, 320, imgFrameHeight)];
int center = mCount/2;
int tmp = center * 2;
int remainder = mCount - tmp;
if (remainder != 0) {
centerImg = center;
} else {
centerImg = center - remainder;
}
imgView1.image = [imgGallery objectAtIndex:(centerImg-2)];
imgView2.image = [imgGallery objectAtIndex:(centerImg-1)];
imgView3.image = [imgGallery objectAtIndex:centerImg];
imgView4.image = [imgGallery objectAtIndex:(centerImg+1)];
imgView5.image = [imgGallery objectAtIndex:(centerImg+2)];
[scrlView addSubview:imgView1];
[scrlView addSubview:imgView2];
[scrlView addSubview:imgView3];
[scrlView addSubview:imgView4];
[scrlView addSubview:imgView5];
}
Below is the code where UIImageViews are adjusted
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
imgView1X = imgView1.frame.origin.x;
imgView2X = imgView2.frame.origin.x;
imgView3X = imgView3.frame.origin.x;
imgView4X = imgView4.frame.origin.x;
imgView5X = imgView5.frame.origin.x;
CGPoint previousOffset = [scrlView contentOffset];
previousOffsetX = previousOffset.x;
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
//get the current offset
CGPoint currentOffset = [scrollView contentOffset];
currentOffsetX = currentOffset.x;
//NSLog(NSStringFromCGPoint(currentOffset));
//calculate offset X of RIGHT ImageView to be shifted
CGFloat identifyRightIV = previousOffsetX +640;
//calcualte new LEFT offset X for shifting the previously calcualted RIGHT ImageView
CGFloat newLX = identifyRightIV - (320*5);
//calculate offset X of LEFT ImageView to be shifted
CGFloat identifyLeftIV = previousOffsetX -640;
//calcualte new RIGHT offset X for shifting the previously calcualted LEFT ImageView
CGFloat newRX = identifyLeftIV + (320*5);
//index of new LEFT Image in an array imgGallery
int newImageL = newLX / 320;
//index of new RIGHT Image in an array imgGallery
int newImageR = newRX / 320;
//if scrolled to left
if (newLX >= 0) // Is shifting is necessary? i.e. if new LEFT offsetX is greater than lowest offsetX(0) of scrollview
{
if (currentOffsetX == (previousOffsetX-320))
{
if (imgView1X == identifyRightIV) {
imgView1.frame = CGRectMake(newLX, 0, 320, imgFrameHeight);
imgView1.image = [imgGallery objectAtIndex:newImageL];
}
else if (imgView2X == identifyRightIV) {
imgView2.frame = CGRectMake(newLX, 0, 320, imgFrameHeight);
imgView2.image = [imgGallery objectAtIndex:newImageL];
}
else if (imgView3X == identifyRightIV) {
imgView3.frame = CGRectMake(newLX, 0, 320, imgFrameHeight);
imgView3.image = [imgGallery objectAtIndex:newImageL];
}
else if (imgView4X == identifyRightIV) {
imgView4.frame = CGRectMake(newLX, 0, 320, imgFrameHeight);
imgView4.image = [imgGallery objectAtIndex:newImageL];
}
else if (imgView5X == identifyRightIV) {
imgView5.frame = CGRectMake(newLX, 0, 320, imgFrameHeight);
imgView5.image = [imgGallery objectAtIndex:newImageL];
}
}
}
//if scrolled to right
if (newRX < (mCount*320)) // Is shifting is necessary? i.e. if new RIGHT offsetX is less than highest offsetX of scrollview
{
if (currentOffsetX == (previousOffsetX+320))
{
if (imgView1X == identifyLeftIV) {
imgView1.frame = CGRectMake(newRX, 0, 320, imgFrameHeight);
imgView1.image = [imgGallery objectAtIndex:newImageR];
}
else if (imgView2X == identifyLeftIV) {
imgView2.frame = CGRectMake(newRX, 0, 320, imgFrameHeight);
imgView2.image = [imgGallery objectAtIndex:newImageR];
}
else if (imgView3X == identifyLeftIV) {
imgView3.frame = CGRectMake(newRX, 0, 320, imgFrameHeight);
imgView3.image = [imgGallery objectAtIndex:newImageR];
}
else if (imgView4X == identifyLeftIV) {
imgView4.frame = CGRectMake(newRX, 0, 320, imgFrameHeight);
imgView4.image = [imgGallery objectAtIndex:newImageR];
}
else if (imgView5X == identifyLeftIV) {
imgView5.frame = CGRectMake(newRX, 0, 320, imgFrameHeight);
imgView5.image = [imgGallery objectAtIndex:newImageR];
}
}
}
}
Due to this in entire life cycle only 5-UIImageViews will be in App & all images will be safe in array.
try this code for 1st question:
scrl=[[UIScrollView alloc]initWithFrame:CGRectMake(10, 92, 300, 370)];
//scrl.backgroundColor=[UIColor blackColor];
scrl.delegate=self;
scrl.showsHorizontalScrollIndicator=NO;
scrl.showsVerticalScrollIndicator=NO;
scrl.pagingEnabled=YES;
scrl.layer.cornerRadius = 5.0f;
scrl.layer.masksToBounds = YES;
scrl.layer.borderWidth = 5;
scrl.layer.borderColor = [UIColor blackColor].CGColor;
int i, x=0,y=0;
for (i=0; i<[imageName count]; i++)
{
imagBack=[[UIImageView alloc] initWithFrame:CGRectMake(x,y,300, 370)];
imagBack.image=[UIImage imageNamed:[imageName objectAtIndex:i]];
[scrl addSubview:imagBack];
x =x+300;
}
scrl.contentSize=CGSizeMake(x,370);
[self.view addSubview:scrl];
-> 2nd issue,you use the image to be compressed (.png format) image is ,try this:
[self imageWithImage:image CovertToSize:CGSizeMake(46, 44)];
NSData* imageData = UIImageJPEGRepresentation(image, 1.0f);//10 % quality compressed
call this method when save the image:
-(UIImage *)imageWithImage:(UIImage *)image CovertToSize:(CGSize)size {
UIGraphicsBeginImageContext(size);
[image drawInRect:CGRectMake(0, 0, size.width, size.height)];
destImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return destImage;
}

Why are CALayers stacking ontop of each other as I scroll my UITableView?

I have a UITableViewCell with a UIImage that I'm drawing. As I scroll, I get a ton of sublayers getting added which makes performance really jerky. How can I make sure my CALayer only gets added once?
- (void) drawContentView:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
[[UIColor whiteColor] set];
CGContextFillRect(context, rect);
NSString* caption = [NSString stringWithFormat:#"%#",[info objectForKey:#"caption"]];
NSString* text = [info stringForKey:#"text"];
CGFloat widthr = self.frame.size.width - 70;
[[UIColor grayColor] set];
[text drawInRect:CGRectMake(63.0, 25.0, widthr, 20.0) withFont:system14 lineBreakMode:UILineBreakModeTailTruncation];
if (self.image) {
UIImage *imageToDisplay;
imageToDisplay = self.image;
imageToDisplay = [self imageWithImage:imageToDisplay scaledToSize:CGSizeMake(imageToDisplay.size.width / 1.5, imageToDisplay.size.height / 1.5)];
CGFloat width;
CGFloat height;
CGRect r;
if (imageToDisplay.size.width < 310 && imageToDisplay.size.height > 290) {
imageToDisplay = [self imageByCropping:imageToDisplay toRect:CGRectMake(0, 20, imageToDisplay.size.width, 270)];
}
else if (imageToDisplay.size.width > 310 && imageToDisplay.size.height < 20) {
imageToDisplay = [self imageByCropping:imageToDisplay toRect:CGRectMake(30, 0, 290, imageToDisplay.size.height)];
}
else {
if (![caption isEqualToString:#""]) {
imageToDisplay = [self imageByCropping:imageToDisplay toRect:CGRectMake(30, 0, 290, 230)];
}
else {
imageToDisplay = [self imageByCropping:imageToDisplay toRect:CGRectMake(30, 0, 290, 270)];
}
}
width = imageToDisplay.size.width;
height = imageToDisplay.size.height;
r = CGRectMake(5.0, 5.0, width, height);
//[imageToDisplay drawInRect:r];
CALayer *sublayer = [CALayer layer];
sublayer.contents = (id)imageToDisplay.CGImage;
sublayer.shadowOffset = CGSizeMake(0, 3);
sublayer.shadowRadius = 5.0;
sublayer.shadowColor = [UIColor blackColor].CGColor;
sublayer.shadowOpacity = 0.8;
sublayer.frame = CGRectMake(5.0, 5.0, imageToDisplay.size.width, imageToDisplay.size.height);
[self.layer addSublayer:sublayer];
//Experimental shadow stuff with images
/*CALayer *layer = [CALayer layer];
layer = [CALayer layer];
layer.bounds = CGRectMake(5.0, 5.0, imageToDisplay.size.width, imageToDisplay.size.height);
layer.position = CGPointMake(150, 140);
layer.contents = (id)imageToDisplay.CGImage;
layer.shadowOffset = CGSizeMake(0, 2);
layer.shadowOpacity = 0.70;
[self.layer addSublayer:layer];
[self bezierPathWithCurvedShadowForRect:layer.bounds];*/
[[UIColor blackColor] set];
[caption drawInRect:CGRectMake(10.0, height + 20 , widthr, 20.0) withFont:system14 lineBreakMode:UILineBreakModeWordWrap alignment:UITextAlignmentCenter];
}
}
drawContentView: is not the right method from which to call addSublayer:. You should add that layer at the point when you construct your object with an image, or when you set an image on an existing object. Alternatively, you can draw the image yourself in the drawContentView:, but it is probably not going to be as fast.

How can I position my UIView to the bottom of the screen?

I have the following code to show a little notification bar right above a UITabViewController:
- (void)showNotificationBar
{
if(mentionsButton.hidden)
{
//DM button on the left
[dmButton setFrame:CGRectMake(20,-2, 140, 35)];
[directMessagesPill setFrame:CGRectMake(6, 7, 29, 20)];
[dmCountLabel setFrame:CGRectMake(11, 5, 19, 21)];
[directMessagesLabel setFrame:CGRectMake(43, 6, 81, 21)];
//Mentions on the right
[mentionsButton setFrame:CGRectMake(162,-2, 140, 35)];
[mentionsPill setFrame:CGRectMake(161, 7, 29, 20)];
[mentionCountLabel setFrame:CGRectMake(166, 6, 19, 21)];
[mentionsLabel setFrame:CGRectMake(193, 6, 86, 21)];
}
else
{
//Mentions on the left
[mentionsButton setFrame:CGRectMake(20,-2, 140, 35)];
[mentionsPill setFrame:CGRectMake(6, 7, 29, 20)];
[mentionCountLabel setFrame:CGRectMake(11, 5, 19, 21)];
[mentionsLabel setFrame:CGRectMake(43, 6, 81, 21)];
//DM on the right
[dmButton setFrame:CGRectMake(162,-2, 140, 35)];
[directMessagesPill setFrame:CGRectMake(161, 7, 29, 20)];
[dmCountLabel setFrame:CGRectMake(166, 5, 19, 21)];
[directMessagesLabel setFrame:CGRectMake(193, 6, 86, 21)];
}
if(!mentionsButton.hidden && !dmButton.hidden)
notificationDivider.hidden = NO;
if(!self.tabBarController.tabBar.hidden)
{
//CGRect frame = CGRectMake(0, 0, 320, 32);
CGRect frame = CGRectMake(0, 500, 320, 32);
//frame.origin.y = CGRectGetMaxY(self.navigationController.navigationBar.frame) - frame.size.height;
frame.origin.y = self.tabBarController.tabBar.frame.origin.y;
notificationBar.frame = frame;
//[self.navigationController.navigationBar.superview insertSubview:notificationBar belowSubview:self.navigationController.navigationBar];
[self.tabBarController.tabBar.superview insertSubview:notificationBar belowSubview:self.tabBarController.tabBar];
[UIView animateWithDuration:0.5 animations:^{
CGRect frame = notificationBar.frame;
//frame.origin.y = CGRectGetMaxY(self.navigationController.navigationBar.frame);
frame.origin.y -= frame.size.height;
notificationBar.frame = frame;
}];
}
else
{
CGRect frame = CGRectMake(0, 500, 320, 32);
frame.origin.y = self.navigationController.toolbar.frame.origin.y;
notificationBar.frame = frame;
[self.navigationController.toolbar.superview insertSubview:notificationBar belowSubview:self.navigationController.toolbar];
[UIView animateWithDuration:0.5 animations:^{
CGRect frame = notificationBar.frame;
frame.origin.y -= frame.size.height;
notificationBar.frame = frame;
}];
}
}
The problem is, there is a gap between this UIView and a UIToolbar when I switch tabs to a UINavigationController that hides the tabbar. How can I reposition it so that it goes down?
If i have understod your problem correctly this should do:
What I would do is to put the positioning code for the notification bar on another function, since you also insert subviews in this piece of code. You should call it form here and in the view did load methods of this UIViewController and the UINavigationController that you call.
A trick to position correctly the the notification bar without much trouble would be to use the toolbar y position as a reference, since it is updated automatically.
CGrect frame = notificationBar.frame;
frame.y = self.navigationController.toolbar.frame.origin.y - notificationBar.frame.size.height;
notificationBar.frame = frame;
I hope this helps.

reasons why a UIButton with image doesn't always fire?

I'm at a loss.. I have a UIButton which almost works well.
98% of the time it fires the selector when pressed.
2% of the time it seems to get stuck for a while... about 5 seconds not accepting touches, then it magically starts working again.
This is how I declare it.. In the init of the parent frame:
CGRect frame = CGRectMake(0, 0, 320, VIEW_FRAME_HEIGHT);
self.frame = frame;
self.autoresizingMask = UIViewAutoresizingFlexibleWidth;
self.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:BACKGROUND_ALPHA];
selectedLocationIndex = 0;
// create next/previous buttons
[nextButton release];
UIImage *nextImage = [IMagesClass getImage:IMAGE_KEY_NEXT];
CGRect nextFrame = CGRectMake(0, 0, nextImage.size.width + BUTTON_PADDING, nextImage.size.height + BUTTON_PADDING);
nextButton = [[UIButton alloc] initWithFrame:nextFrame];
nextButton.backgroundColor = [UIColor greenColor];
[nextButton setImage:nextImage forState:UIControlStateNormal];
[nextButton addTarget:delegate action:#selector(onChangeLocation:) forControlEvents:UIControlEventTouchUpInside];
nextButton.showsTouchWhenHighlighted = YES;
nextButton.tag = NEXT_LOCATION;
nextButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
nextButton.center = CGPointMake(self.frame.size.width - (BUTTON_INSET + (nextButton.frame.size.width / 2.0)), VIEW_FRAME_HEIGHT / 2.0);
[self addSubview:nextButton];
I appreciate any help! Thanks!