File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,13 @@ public struct SwipeMenuViewOptions {
19
19
20
20
public struct ItemView {
21
21
/// ItemView width. Defaults to `100.0`.
22
+ /// needsAdjustItemViewWidth がfalseの際に適用される
22
23
public var width : CGFloat = 100.0
23
24
25
+ /// ItemViewminimum width.
26
+ /// needsAdjustItemViewWidth がtrueの際に設定した値以下のWidthにならないように調整する
27
+ public var minimumItemWidth : CGFloat = 0
28
+
24
29
/// ItemView side padding. Defaults to `5.0`.
25
30
public var padding : CGFloat = 5.0
26
31
Original file line number Diff line number Diff line change @@ -235,7 +235,9 @@ open class TabView: UIScrollView {
235
235
case . flexible:
236
236
if options. needsAdjustItemViewWidth {
237
237
var adjustCellSize = tabItemView. frame. size
238
- adjustCellSize. width = tabItemView. titleLabel. sizeThatFits ( containerView. frame. size) . width + options. itemView. padding * 2
238
+ let adjustWidth = tabItemView. titleLabel. sizeThatFits ( containerView. frame. size) . width + options. itemView. padding * 2
239
+ let adjustCellSizeWidth = max ( adjustWidth, options. itemView. minimumItemWidth)
240
+ adjustCellSize. width = adjustCellSizeWidth
239
241
tabItemView. frame. size = adjustCellSize
240
242
241
243
containerView. addArrangedSubview ( tabItemView)
You can’t perform that action at this time.
0 commit comments