小编mag*_*tak的帖子

将"填充"添加到UITextView

正如标题所说我试图向UITextView添加类似填充的行为.在我的导航控制器中按下视图时会生成textview,并出现以下代码:

 self.textView.layer.cornerRadius = 7;
 //pretty stuff is pretty

 NSString *description = appDelegate.productInDisplay.description;
 [self.textView setText:description];
 //pretty stuff has content now


 CGRect frame = textView.frame;
 frame.size.height = textView.contentSize.height;
 textView.frame = frame;
 //set the UITextView to the size of it's containing text.

 self.textView.editable = NO;

  self.theScrollView.contentSize = CGSizeMake(320, 250 + textView.frame.size.height);
  //set the parent scrollView's height to fit some other elements with fixed size (250)
  //and the pre-mentioned UITextView
Run Code Online (Sandbox Code Playgroud)

所以,它一切正常,没关系,但我想在UITextView的所有4个方面添加一些填充,我已经无法用3小时的谷歌搜索看起来相当容易的东西.有什么建议?

padding uitextview ios

36
推荐指数
6
解决办法
4万
查看次数

使用php打开OTF字体 - 包括希腊字符

所以,正如标题所说,我的任务是使用选定的.otf字体将给定的短语转换为服务器端的图像(php GD).这个短语不仅包括拉丁字符,还包括希腊语和西里尔字母.

PHP的imagettftext(http://php.net/manual/en/function.imagettftext.php)不适用于.otf字体上的非拉丁字符(看起来与.ttf一样正常).

有线索吗?

编辑:字体需要是.otf

php fonts gd imagettftext

6
推荐指数
2
解决办法
7600
查看次数

哪个内存在我的for ... in循环中使用addObject泄漏

以下循环中似乎存在一些内存泄漏:

NSMutableArray *array1 = [[NSMutableArray alloc] init];
for(SomeClass *someObject in array2){    //has already been populated;
    if (someObject.field == desiredValue){
        [array1 addObject:someObject];
    }
}
//EDIT:
//use array1 for very secret operations
[array1 release];
Run Code Online (Sandbox Code Playgroud)

有什么想法吗?

memory-leaks nsmutablearray ios

5
推荐指数
1
解决办法
877
查看次数