Skip to content

Commit 3e66d09

Browse files
muronggjuzi214032
authored andcommitted
fix(Calendar): 修复全面屏机型适配问题
close #1188
1 parent 3552e52 commit 3e66d09

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

config/styles/_mixins.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,10 @@
2727
content: ' ';
2828
background-color: @active-color;
2929
border-color: @active-color;
30+
}
31+
32+
// 解决全屏幕机型底部适配问题
33+
.safe-area-inset-bottom() {
34+
padding-bottom: constant(safe-area-inset-bottom) !important; /* 兼容 iOS < 11.2 */
35+
padding-bottom: env(safe-area-inset-bottom) !important; /* 兼容 iOS >= 11.2 */
3036
}

src/calendar/calendar.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</mounth>
2424
</scroll-view>
2525
<view>
26-
<l-button type="default" size="long" bind:lintap="onClickConfirm" bg-color="{{ color }}">{{confirmText}}</l-button>
26+
<l-button type="default" l-class="bottom-button" size="long" bind:lintap="onClickConfirm" bg-color="{{ color }}">{{confirmText}}</l-button>
2727
</view>
2828
</view>
2929
</template>

src/calendar/index.less

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@import "../../config/styles/_theme.less";
2+
@import "../../config/styles/_mixins.less";
3+
14
.calendar-container{
25
display: flex;
36
height: 1000rpx;
@@ -22,4 +25,10 @@
2225
// color: #555;
2326
// border-top-left-radius: 12rpx;
2427
// border-top-right-radius: 12rpx;
25-
// }
28+
// }
29+
30+
.bottom-button {
31+
padding: 0 !important;
32+
.safe-area-inset-bottom();
33+
box-sizing: content-box !important;
34+
}

0 commit comments

Comments
 (0)