فهرست منبع

button的横屏宽度调整

onecold 1 سال پیش
والد
کامیت
6de81694d8

+ 2 - 2
entry/src/main/ets/pages/AboutPage.ets

@@ -165,7 +165,7 @@ export struct AboutPage{
             })
 
           Button('加入Q群:685109858', { type: ButtonType.Capsule, stateEffect: false })
-            .width('60%')
+            .width(this.currentBreakpoint !== BreakpointTypeEnum.SM?'25%':'60%')
             .height(55)
             .margin({top:50,bottom:20})
               // .visibility(Visibility.None)
@@ -183,7 +183,7 @@ export struct AboutPage{
             })
 
           Button('用户反馈', { type: ButtonType.Capsule, stateEffect: false })
-            .width('60%')
+            .width(this.currentBreakpoint !== BreakpointTypeEnum.SM?'25%':'60%')
             .height(55)
             .stateEffect(true)
             .margin({bottom:20})

+ 6 - 5
entry/src/main/ets/pages/ScanFilePage.ets

@@ -245,7 +245,7 @@ export struct ScanFilePage{
                 .fontWeight(480)
                 .layoutWeight(1)
             }
-            .width('100%')
+            // .width('100%')
             .margin({ left:25,right: 25 ,top:20 })
 
 
@@ -266,20 +266,22 @@ export struct ScanFilePage{
                 .layoutWeight(1)
 
             }
-            .width('100%')
+            // .width('100%')
             .margin({ left:25,right: 25 ,top:20,bottom:20 })
 
           }
+          .width(this.currentBreakpoint !== BreakpointTypeEnum.SM?'50%':'85%')
           .backgroundColor($r('app.color.index_background'))
           .margin({ left:25,right: 25,top:20,bottom:20  })
           .borderRadius(20)
+          .justifyContent(FlexAlign.Center)
           .transition(TransitionEffect.move(TransitionEdge.BOTTOM)
             .animation({ duration: 380, curve: Curve.Ease,delay:60 }))
 
           Column() {
             Button(this.isStart?'正在扫描':$r('app.string.start_scan'), { type: ButtonType.Capsule, stateEffect: false })
 
-              .width('60%')
+              .width(this.currentBreakpoint !== BreakpointTypeEnum.SM?'25%':'60%')
               .height(55)
               .margin({ top: 20, bottom: 10 })
               .linearGradient({
@@ -294,8 +296,7 @@ export struct ScanFilePage{
               .alignSelf(ItemAlign.Center)
 
             Button(this.isStartCover?'正在扫描':$r('app.string.onekey_cover'), { type: ButtonType.Capsule, stateEffect: false })
-
-              .width('60%')
+              .width(this.currentBreakpoint !== BreakpointTypeEnum.SM?'25%':'60%')
               .height(55)
               .margin({ top: 10, bottom: 20 })
               .linearGradient({

+ 3 - 2
entry/src/main/ets/pages/UserCenter.ets

@@ -778,11 +778,12 @@ export struct UserCenter {
       Button(this.isVip ? '升级会员' : '立即开通')
         .borderRadius(24)
         .backgroundColor(this.isDarkMode ? $r('app.color.user_center_button_background') : this.themeColor)
-        .width('90%')
+        .width(this.currentBreakpoint !== BreakpointTypeEnum.SM?'25%':'60%')
         .fontColor(Color.White)
         .fontSize(18)
+        .padding(12)
         .fontWeight(FontWeight.Bold)
-        .margin({ top: 8, bottom: 8 })
+        .margin({ top: 1, bottom: 15 })
         .alignSelf(ItemAlign.Center)
         .onClick(() => {
           if (!this.isLogin) {

+ 1 - 1
entry/src/main/ets/pages/VipPage.ets

@@ -533,7 +533,7 @@ export  struct  VipPage{
             })
         }
         .margin({top:15,bottom:66})
-        .width('60%')
+        .width(this.currentBreakpoint !== BreakpointTypeEnum.SM?'25%':'60%')
 
       }
       .layoutWeight(1)