【问题标题】:align image inside textView在 textView 中对齐图像
【发布时间】:2014-09-03 18:17:11
【问题描述】:

我想知道如何实现诸如跟踪用户个人资料图像在文本视图中的位置之类的功能。目前我已经创建了一个包含 textView 的 customTableViewCell。

【问题讨论】:

  • 你想让文字在图像周围流动吗?即,在上图中,从第 4 行左右开始与图像的左边缘对齐?
  • 是的,它应该到处流动

标签: ios objective-c iphone swift


【解决方案1】:

不要在 textview 中添加 imageView,而是让 imageView 和 textview 成为你 customTableViewCell 的子视图。

imageView.frame = CGRectMake(0.0,0.0 40.0,40);
textview.frame = CGRectMake(45.0,0.0,self.view.width-45,40);
[self addSubview: imageView];
[self addSubview: textview];

【讨论】:

  • 但是文本将如何围绕图像对齐?
猜你喜欢
  • 2014-08-14
  • 1970-01-01
  • 2012-05-03
  • 1970-01-01
  • 1970-01-01
  • 2014-10-29
  • 2011-09-16
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多