NSTextField subclass for sliding text - Objective-C/Cocoa - objective-c

I want to do what is described here. I know I am kinda repeating the question but that post does not have an answer. I have searched the net and didn't find anything I could understand either.
So, here is my problem: I want to create an NSTextField subclass that animates text (in the way described by the other post) when the text is too long to be completely displayed. I have absolutely no idea on how to do this, so some sample code would be nice for complicated answers. If it helps, I only want to use this to animate labels (text not selectable nor editable). Thanks.

It seems that this SO entry is close to what you need. It is not based on a NSTextField but on a NSView, but the result is what you are looking for and it should note be hard to modify.

Those links should show you the way :
Making uitextview scroll programmatically
Auto Scrolling UITextView Problem
They talk about iPhone classes, but I'm sure you will be able to adapt them for NSTextField.

Related

Placing Strings at a specific point on images in objective C

I'm trying to create an image made out of text in objective c, but I can't figure out how to put the text onto a new image. The basic idea is that it's going to be shapes made out of text, so I need to be able to specify points. Currently I am trying to do it with a bitmap, but the format doesn't really matter. I may be missing something simple, but any suggestions would be appreciated.
One approach is to render your text and other things to a custom UIView. After that, you can capture that UIView to a UIImage.
This answer on SO will help in terms of rendering the UIView to UIImage. There are various tutorials about rendering a custom UIView. You may just want to override a particular component as well such as overriding the UITextField.
For OSX, you'd want to look into NSView and NSImage - this answer may help.

programmatically implement UIScrollView in a UIAlertView

I would like to programmatically Add a UIScrollView in a UIAlertView.
I found a way to do that but I was not successful in adding text to this UIScrollView (using the same code as in here: https://www.youtube.com/watch?v=4SG0CAAl5u0).
is there an alternative to do that? the text I have is very long and I need people to be able to scroll but without being able to edit it.
I know that the Apple user interface guideline does not recommend long text in alerts (although detecting WiFi networks does that) but I have no choice but doing it
If you add a large text in UIAlertView it automatically becomes scrollable.
You don't have to do any thing to make it scrollable.
Here is a control on github that has a tabelView inside it. If you need to customize beyond what Inder suggests, you might want to look at the code and replace the tableView with a scrollView.
Also, there are other controls at cocoacontrols.com that might help you directly or give you some ideas.

Image on top of uiTableView

Im little lost here,thats what i need to do:
But the tableview seems to take all the view and the image just gone...its possible to do that?
Use a UIView, put your UIImageView on the top, tableview at the bottom inside the UIView.
Yes it's possible.
Looking at your attached screenshot, it looks like you have the gist of it. That said, your question is quite vague without further details it will be unlikely people will be able to address your problem

UITextView scroll

This is a real n00b question but i am very new at this and have been looking for an answer and also read the reference as i am trying to work with UITextView.
I want to add quite a lot of text into a view and i want it to be scrollable.
I have created the UITextView in IB, added text via "self.myTextView.text = #"...", which works. However i am not able to scroll down and see all text. I see only the amount of text that fits in the view i have.
I wonder if someone nice could help me and give an example/hint how to get the UITextView scrollable.
Thank you.
If it's static text and you'd like some formatting, I recommend using a UIWebView. You can give it a variety of files types, and edit the file easily.

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.