UiTextView doesn't display text on iphone os 2.0 - iphone

My text view shows the text when i am using iphone OS 3.0-
but for some reason it will not show the text on OS 2.0.
I can get the inputed text on OS 2.0 and even save it to file,
and then restore the text but still- the text is not visible on OS 2.0.
I have tried changing the scrolling properties and the font and the color and the hidden property -
Anybody have an idea what it is?
Thanks-
Nir.

Answering my own question:
I added my text view to a button view-
so i changed it and now I am adding it to a uiView.
I guess there is a different way for displaying a text field on top of a button in the old OS 2.0.

Related

tvOS: Change UITextField text color [duplicate]

Editing UITextField in tvOS shows a new view where the user can enter in text, and when text entry is done, the user is returned to the previous view. However, I have found that when I return from the text editor, the text I edit does not show up in my text fields. What's going on?
tvOS version 9.1
The reason why it isn't working is because the UITextField is using a non-default background color. Apparently in tvOS, the background color is rendered to the layer after the text has been rendered (Interestingly enough, this does not affect placeholder text). This also happens in interface builder. A bug report has been sent to Apple.
I had a similar issue with shared iOS/tvOS code where the next textfield placeholder text disappeared and became unresponsive.
Make sure that you are NOT setting textField.endEditing(true)

UILabel automatically changes color

i'm facing a really strange problem: i have some UILabel in my view, which has a black background, so i set their text color to white in Interface Builder in order to see them, the problem is, when i run the app on the simulator or on my iphone with ios7 or iOS 6.1.3 i can update them without problems (for update i mean: myLabel.text = #"Something")
but when i run the app on my sister's iphone 3gs with iOS 6.0 at the moment i update them the font color turns black. It seems that on her phone the label can't remember the color set on IB.
Does anyone of you know why this happens?
Thanks
It sounds like you have set the label "type" to "Attributed" in Interface Builder.
If this is the case then it is not the label that holds the text colour. It is the text itself.
If you replace the text with something else then the default text color of black will be used.
If you want to continue using Attributed text then you need to add a "foregroundColor" attribute to the text before setting it to the label.
The easier way round this is to change the label type to "Plain" in Interface Builder.
Of course, this depends on you having set it to Attributed.
I think you shouldn't use default label color in the interface builder, just provide something else (black color or etc.).
I ran into a similar problem. Was stumping me completely, until I quit and relaunched the simulator. It wasn't enough to just close the window or rebuild. I had to cmd-q, then build and launch again. Magically fixed the issue. Annoying.. but worked for me

Underline / Bold in UITextView

Is it possible to underline or embolden certain bits of text in a UITextView?
For example my Text View has headings in it, and would like those underlined...
Random Mode
In random mode, you can generate numbers...
Sweepstake Mode
In sweepstake mode...
If not, what is the best way to achieve this?
Thanks
Use should use NSAttributedString, and use controllers for drawing NSAttributesString.
Controller for NSAttributedString
Note: you can't use UITextView to display a NSAttributedString
Update
From iOS6, UILabel now support NSAttributedString, you should use UILabel directly instead of OHAttributedLabel as it is now natively supported by the OS.
I believe NSAttributedString is what you're after, it's available in iOS 3.2 or later: look at this question
I know this is an old thread, but this is something I just discovered myself. At least in Xcode version 4.6.3 this is possible by using an attributed textView. What's even better is that it's possible to all be done in Interface Builder!
Here are the steps:
Place your textView at the desired location
Select the textView and open up the Attributes tab under the Utilities panel
Change the textView text to "attributed"
Enter your desired text
Now, highlight whatever text you want bolded, underlined, etc.
Click on the "T" button next to the fontName
In the popup, select your desired typeface (ex: Bold)
You should see the desired typeface displayed in the Utilities panel
Enjoy!

UITextField: Text Entered Programmatically but not Visible in the Text Field

I have a weird behaviour that has only shown up in the last week. I don't use IB, all the controls are created in code.
I have a text field with a keyboard active. The first time I load the text field and use the keyboard, everything works normally. The second time I use it, the typed text does not show in the text field. However, the text is in the text field programmatically. For example, I can use it to execute a search. When the keyboard closes, the text appears.
Some of my UITextFields have misaligned text. For example, I write "hello", and instead of displaying centered inside the field like normal, it displays shifted several pixels downward to the extent that the bottom of the text is cut off. It's almost as if another view is chopping the bottom off the text by obscuring it.
I use three20, but according to http://groups.google.com/group/three20/browse_thread/thread/d7c4bc1ee2f9590d#, Xcode is suspected of causing the problem. I seen the behavior on 2 diferent macs, one running with Snow Leopard (10.6) and the other with Leopard (10.5).
This is how the problem looks in Xcode:
It is not obvious, but there is text in that search field. Notice that the placeholder text is not show. However, if I hit Search, the code executes with the entered text.
This is how the app appears in the simulator:
I finally find the reason.
I call [textField becomeFirstResponder] in a function called from loadView. But I move it to viewDidAppear and everything work Ok...
I've seen that happen with text fields and affine transforms. If you rotate a text field using a transform, the text shows up in a seemingly random part of the superview. If you use a transform to move the text field to make room for the keyboard, you might be seperating the embedded text editor from the field itself. That would also explain why the text is in the code because the text attribute of the text field is not affected by the visual layout of the UI.

iPhone Development - Keyboard does not automatically adjust when taking input using TextField placed in a TableView

I just downloaded 2.2.1 and i've seen that my input view does not adjust itself when an input field (NSTextField) is selected. Earlier the view was adjusting itself w.r.t keyboard.
I was using 2.1. How can i achieve the same effect?
This was a bug, which has been fixed by Apple.