incubator-weex icon indicating copy to clipboard operation
incubator-weex copied to clipboard

[Android]当slider中嵌套scroller的时候,scroller设置flex:1,scroller并没有占满父视图

Open tonlion opened this issue 5 years ago • 1 comments

复现代码:

<template>
	<div>
		<slider class="slider" interval="3000" auto-play="true">
			<div class="frame" v-for="img in imageList">
				<scroller class="scroller">
					<text class="imgSrc">{{ img.src }}</text>
				</scroller>
			</div>
		</slider>
	</div>
</template>

<style scoped>
.slider {
	flex: 1;
	margin-top: 25px;
	margin-left: 25px;
	width: 700px;
}
.frame {
	flex: 1;
	width: 700px;
	position: relative;
	background-color: yellow;
}
.scroller {
	flex: 1;
	width: 700px;
	background-color: red;
}
.imgSrc {
	flex: 1;
	color: white;
	text-align: center;
	font-size: 100px;
	font-style: bold;
}
</style>

<script>
export default {
	data() {
		return {
			imageList: [{ src: '1' }, { src: '2' }, { src: '3' }]
		};
	}
};
</script>

从现象上看,实际高度只占父高度的1/imageList.length。

tonlion avatar Jun 24 '19 10:06 tonlion

同问

WeiFu3 avatar Mar 12 '21 08:03 WeiFu3