how to set UItextfield border color in xcode 6 - xcode6

I've been trying (for weeks) to set uitextfield/view border color in xcode 6 but still not working. I already tried any solutions I found on stackoverflow and other forums too but still not working. I use Objective-C Any help? Thanks

First You Need to import Core Graphics File in your implementation file:
#import <QuartzCore/QuartzCore.h>
then use this code to change color of border:
txtPass.layer.borderColor=[[UIColor redColor]CGColor];
txtPass.layer.borderWidth= 1.0f;
If You want to give border then use
txtPass.layer.cornerRadius=8.0f;
txtPass.layer.masksToBounds=YES;

Here is how I made it! And thanks a lot guys

Related

Unable to set height of NSButton

I have some NSButtons of style Round Textured inserted into an NSToolbar.
I have created some custom images for the buttons and would like to make them vertically bigger, however the height field for the button is greyed out.
Anyone got any ideas why, and if there is a way around it?
Thanks
Gareth
From NSButtonCell Class Reference
NSTexturedRoundedBezelStyle The height of this button is fixed.
You can use NSTexturedSquareBezelStyle Bezel Styles
You have to uncheck Bordered in the latest version of XCode

How to display .m file content in objective c programmatically?

I need to display the content of a .h/.m file on the iPhone's screen, maybe in a UITextView, how can I do that ?
The problem is that i need the code to be coloured exactly as shown in code.
Thank you in advance.
You should take a look at my answer to this question.
The best solution seems to be ParseKit.

unknown pattern color for the background color attribute

Getting the compiler warning:
Unsupported Configuration:
Unknown pattern color for the Background Color attribute
on my xib when trying to set the background color of a UIView to clear in interface builder. I swear I've made a UIView clear in the past without any trouble. Google isn't giving me anything useful. I feel like there is a head-slapping-simple answer here but after 14 hours at the keyboard (not on this issue) my tired mind isn't figuring it out.
I had lot of problem with the same issue. I solved this by this way
"select the UIView in interface builder, background color first set default color in option and build it".
I started getting this warning after updating to Mavericks and Xcode 5.1.1
I read elsewhere that the clearColor was the cause of this warning but in my case it was a pattern very similar to the standard Apple dark grey style background you see after updating an iPhone. No idea how it got there, don't remember ever asking for a pattern rather than a color nor how to select a pattern in the color selector popup. Perhaps it was chosen by IB because something in my original code was missing.
I changed it to Default, rebuilt and the warning has not returned. The only problem was going through each UIView until I found the one causing the warning because the background preview dropbox control in attributes is tiny.
Once aware of it, the pattern can be seen instead of a color
This is going to be a compile time error in XCode 8 (beta). Storyboard wont even open.
So we need to open storyboard in editor mode in XCode 7.x and search for "pattern" text and find the view as suggested by #Gordon Dove and fix it by changing the pattern to a plain color.

Add UIButton to UITextView Dynamically with UserInteractionEnabled

I am building an app where I need to add buttons to a UITextView dynamically on the basis of text entered by the user in the same UITextView.
The look I want to give is something like To field in message app of iPhone
I am unsable to figure out the way to do the needful.
Any help would be highly appreciated.
Thanks in advance!!
I found out the solution to my problem and no one has yet answered here so will reply to my own question.
I tried to keep a UITextView on a UIScrollView and then kept changing the width of the UItectView and added button to the left of it depending on the text added in the the textView. This will help in giving an appearance similar to that of a textfield with dynamic addition of UIButton.
Hope this wolrs for all those having the similar problem.

Adding Emboss to a UILabel in a navigationItem.titleView (as seen with navigationItem.title)

I'm trying to mimic the default emboss that automatically gets applied to navigationItem.title, as well as many other UIKit controls.
As seen in this screenshot's title ("Table Cells"):
(source: quicksnapper.com)
I'm essentially trying to add 2 UILabels to the navigationItem.titleView, however the UILabels just show up as flatly drawn and it really just doesn't feel/look right :P
I've thought about playing with shadows, but that would only give the embossed look (if even that) on one side of the label.
Any ideas would be great!
Thanks
Yeh thanks! I just figured it out:
where postTitle is set to a white colour, i just added a darkGray shadow with a vertical offset of 1px.
[postTitle setShadowColor:[UIColor darkGrayColor]];
[postTitle setShadowOffset:CGSizeMake(0, -1)];
Looks exactly like anything you'd put in a .title :)
shadow and shadowOffset are what you're looking for I think. Set those properties on the label and it should do what you want.
A white shadow and a plus one instead a minus one as offset gives that depressed embossed look.