|
@@ -429,12 +429,30 @@ struct TSFeatureItemView: View {
|
|
|
Spacer().frame(height: 8)
|
|
|
Image(image).resizable().frame(width: 24, height: 24)
|
|
|
Spacer().frame(height: 8)
|
|
|
- Text(text).frame(height: 48).padding(EdgeInsets(top: 0, leading: 3, bottom: 8, trailing: 3)) //.frame(height: 48, alignment: .center)
|
|
|
+ WordWrappingText(text: text).frame(height: 48).padding(EdgeInsets(top: 0, leading: 3, bottom: 8, trailing: 3)) //.frame(height: 48, alignment: .center)
|
|
|
}
|
|
|
}.frame(width: 80*kDesignScale,height: 96)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+struct WordWrappingText: View {
|
|
|
+ let text: String
|
|
|
+
|
|
|
+ var body: some View {
|
|
|
+ if #available(iOS 15.0, *) {
|
|
|
+ Text(text)
|
|
|
+ .lineBreakMode(.byWordWrapping)
|
|
|
+ .lineLimit(nil)
|
|
|
+ .frame(maxWidth: .infinity, alignment: .center)
|
|
|
+ } else {
|
|
|
+ Text(text)
|
|
|
+ .fixedSize(horizontal: false, vertical: true)
|
|
|
+ .lineLimit(nil)
|
|
|
+ .frame(maxWidth: .infinity, alignment: .center)
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
extension View {
|
|
|
/// 添加线性渐变背景
|
|
|
/// - Parameters:
|