0
点赞
收藏
分享

微信扫一扫

子view在view区域中水平垂直居中

何以至千里 2022-03-11 阅读 117
<template>
    <view>
		<view class="Center">
			<text style="background-color: #007AFF;">需要居中的内容</text>
			<text>居中内容</text>
			<text>居中内容</text>
			<text>居中内容</text>
		</view>
    </view>
</template>
<style>
	.Center{
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		width: 100%;
		height: 100%;
		position: absolute;
	}
</style>

结果

 

举报

相关推荐

0 条评论