简体   繁体   English

在表格视图单元格 swift ios 上显示 label 中的项目符号

[英]show bullets in label on tableview cell swift ios

附上图片供参考

I have a table view, inside the table view I have multiple cells as shows in attached image.我有一个表格视图,在表格视图中我有多个单元格,如附图所示。 I want to show amenities items like: air conditioning, swimming pool, gym, tv cable etc like bullets.我想展示一些设施项目,比如:空调、游泳池、健身房、电视线等,比如子弹。

How can I achieve this我怎样才能做到这一点

I have all these value in my model coming from API response.我的 model 中的所有这些值都来自 API 响应。

          let ac = "Air Conditioning"
          let tv = "TV Cable"
          let washing = "Washing Machine"
          let connectivity = "Wi-Fi"
          let gym = "Gym"

Good case for stack views...堆栈视图的好案例...

  • Vertical UIStackView垂直UIStackView
  • Each "row" is a Horizontal UIStackView with Distribution: Fill Equally每个“行”都是一个水平UIStackView分布:同样填充

Looks like this - showing Bounds Rectangles:看起来像这样 - 显示边界矩形:

在此处输入图像描述

without the Bounds Rectangles:没有边界矩形:

在此处输入图像描述

view hierarchy:视图层次结构:

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM