English 中文(简体)
在UITextView特定地区增加一些文字?
原标题:Add some text to particular area in UITextView programmatically?

我以方案方式创立了<代码>UITextView。 我愿在以下具体领域增加一些案文:<代码>UITextView。 我的法典是<编码>UITextView。

      UITextView *textView =[[UITextView alloc]init];
      textView.frame=CGRectMake(0,0,282,210);
      [textView setReturnKeyType:UIReturnKeyDone];
      [self.view addSubview:textView];

For example I want to add some text to particular Area CGRectMake(260,190,20,20). Then add this text to UITextView. Programmatically, please any one guide me, how is it possible to do this?

最佳回答

可在网上添加

UITextView *textView = [[UITextView alloc] init];
TextView.frame = CGRectMake(0.0,0.0,282.0,210.0);
[textView setReturnKeyType: UIReturnKeyDone];

UILabel *label = [[UILabel alloc] init];
label.frame = CGRectMake(260.0,190.0,20.0,20.0);
label.text = @"T"; //here you set the text you want...

[textView.view addSubview: label];

[self.view addSubview: textView];
问题回答

暂无回答




相关问题
How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

Iphone NSTimer Issue

Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Xcode open two editor windows with same file

Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...

Forcing code signing refresh in Xcode

In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...

热门标签