@@ -15,7 +15,7 @@ struct MainView: View {
15
15
16
16
@EnvironmentObject var OPassAPI : OPassAPIViewModel
17
17
@ObservedObject var eventAPI : EventAPIViewModel
18
- private let gridItemLayout = Array ( repeating: GridItem ( spacing: CGFloat ( 25.0 ) , alignment: Alignment . top) , count: 4 )
18
+ private let gridItemLayout = Array ( repeating: GridItem ( spacing: CGFloat ( UIScreen . main . bounds . width / 16.56 ) , alignment: Alignment . top) , count: 4 )
19
19
private let logger = Logger ( subsystem: " app.opass.ccip " , category: " MainView " )
20
20
@State private var selectedFeature : FeatureType ? = nil
21
21
@@ -51,12 +51,21 @@ struct MainView: View {
51
51
if !( CheckFeatureIsWebview ( feature. feature) && feature. url? . processWith ( token: eventAPI. accessToken, role: eventAPI. eventScenarioStatus? . role) == nil ) ,
52
52
CheckFeatureVisible ( feature. visible_roles) {
53
53
VStack {
54
- GeometryReader { geometry in
55
- TabButton ( feature: feature, selectedFeature: $selectedFeature, eventAPI: eventAPI, width: geometry. size. width)
56
- . frame ( width: geometry. size. width, height: geometry. size. width)
57
- }
54
+ TabButton (
55
+ feature: feature,
56
+ selectedFeature: $selectedFeature,
57
+ eventAPI: eventAPI,
58
+ width: UIScreen . main. bounds. width / 5.394136
59
+ )
58
60
. aspectRatio ( contentMode: . fill)
59
- . clipShape ( RoundedRectangle ( cornerSize: CGSize ( width: 15 , height: 15 ) ) )
61
+ . frame (
62
+ width: UIScreen . main. bounds. width / 5.394136 ,
63
+ height: UIScreen . main. bounds. width / 5.394136
64
+ )
65
+ . clipShape ( RoundedRectangle ( cornerSize: CGSize (
66
+ width: UIScreen . main. bounds. width / 27.6 ,
67
+ height: UIScreen . main. bounds. width / 27.6
68
+ ) ) )
60
69
61
70
Text ( LocalizeIn ( zh: feature. display_text. zh, en: feature. display_text. en) )
62
71
. font ( . custom( " RobotoCondensed-Regular " , size: 11 , relativeTo: . caption2) )
0 commit comments