Create Circular Button in iPhone SDK [closed] - iphone

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Can any one tell me how to create the rounded button (Circular Button) in iPhone by using interface builder?

If you want a circular button than create an image with a circular shape filled with whatever you want to be displayed in the circle. Make sure your image has an alpha channel and delete all the area around your circle so the background of your image is transparent (alpha =0). (gimp is free and easy to use application for such images)
In IB create a round rect button with type custom button. Select your image as the background of your button and there you have it.

Hope this will help
#import <QuartzCore/QuartzCore.h>
CALayer * l = [control layer];
[l setMasksToBounds:YES];
[l setCornerRadius:5.0];
[l setBorderWidth:2.0];
Adjust cornerRadius according to your need..

Related

apply zoom on sequence image animation and imageview subview of scroll view ios [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have an app which displays a sequence of images.
I want to apply zoom in and zoom out on current image.
The zoom in will be done by pinch effect and zoom out will be done by button click.
What do I have to do?
First You have to set the view which you want to zoom in UIScrollView. In your case it must be UIImageView
use the method of UIScrollView
- (UIView *) viewForZoomingInScrollView: (UIScrollView *) scrollView
{
return _imageView;
}
then you can call the delegate method of UIScrollView
- (void) scrollViewDidZoom: (UIScrollView *) scrollView
{
// add ur code here to center ur image position after zooming
}
also set properties of UIScrollView
minimumZoomScale = 1.0
maximumZoomScale = // ACCORDING TO YOU
And if you want to Zoom Out on button click, then set zoomScale = 1.0 of UIScrollView on IBAction of button

Horizontal and vertical scrolling in a UITableview [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to make a lineup for a festival. You can see what I want to achieve below here.
You can scroll in every direction ,horizontal - vertical and from left to right corner (don't know the proper word in english).If you scroll in one section ever other section should scroll with it.
My question is know how can you achieve this? I'm searching for days to get this working but don't find a good solution...
The row in the UITableView doesn't scrolls itself inside the UITableView. one solution Is to use an UIScrollView and then inside add the UITableView. This UIScrollView will have the same size that your UITableView have now, but the UIScrollView contentSize property will have the same height but it would have a greater width.
UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(x, x, x, x) style:...]
[scrollView addSubview:tableView];
// Set the size of your table to be the size of it's contents
// (since the outer scroll view will handle the scrolling).
CGRect tableFrame = tableView.frame;
tableFrame.size.height = tableView.contentSize.height;
tableFrame.size.width = tableView.contentSize.width; // if you would allow horiz scrolling
tableView.frame = tableFrame;
// Set the content size of your scroll view to be the content size of your
// table view + whatever else you have in the scroll view.
// For the purposes of this example, I'm assuming the table view is in there alone.
scrollView.contentSize = tableView.contentSize;
For better understanding with UITableView scrolling you can follow this two links
horizontally table scrolling
vertically table scrolling
i hope it helps you for better understanding and make familiar with UITableViewDelegate. Thanks

UIViews-masked-off-area-still-touchable [duplicate]

This question already has an answer here:
Mask UIView Touch Detect [closed]
(1 answer)
Closed 9 years ago.
I have Masked UIView . View with blue dots. Green circle Area is masked off.I dont want to get touches on that area.i just want to get touches on visible layer of the View.
Please select touch view in your touch method in place of self.view
May be it helps
Try creating a CGPath of the masked area & then check if the touch falls in ur masked area or not like this :
UIBezierPath *p = [UIBezierPath bezierPathWithCGPath:myCGPath];
BOOL isInPath = [p containsPoint:myCGPoint];
Hope this Helps !!!

UITextView text border [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Border around UITextView
I want to create a border around the text in a UITextView. I was able to accomplish this by creating 8 separate UITextViews and offsetting them to the 8 pixels around the center text. This looks really nice, but inputting text is severely slowed since the view has to update 9 transparent UITextViews simultaneously every time the user types something!
Is there a cleaner/faster way of accomplishing this? The effect I want is similar to photoshops 'stroke' modifier.
Can you put screenshot of what u mean by border around the text ?
If you want to have the border for UITextView try out following, this should work
#import <QuartzCore/QuartzCore.h>
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(10, 10, 300, 100)];
textView.layer.borderColor = [[UIColor redColor] CGColor];
textView.layer.borderWidth = 2;
I'm not sure why my answer was deleted, perhaps because I posted the same solution on an almost identical question? You can find it there:
Bordered UITextView

Gauge implementation in iOS [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I need to implement the gauge in iOS:
Can anyone provide me some idea about how to do this?
I've referred MeterView for iOS but have no idea about how to customize it.
That looks like they are using 3 views. A background view, the needle view and a foreground semi-transparent gloss view.
The background and gloss views are static regular UIImageViews. The needle is a UIImageView with a affine rotation transformation applied to it.
Assuming your needle UIImage view is called needle:
UIImageView *needle = ...;
float theAngle = ...; //How much to rotate, note that this is in radians not degrees
needle.transform = CGAffineTransformMakeRotation(theAngle); // This rotates your needle UIImageView