React Native 中的主体变得可滚动
我对滚动视图有一个小问题。
我希望标题变得粘性,标题后面意味着消息正文变得可滚动。
我已经尝试过以下一种实现方式。
HelpComponentContainer:---
<View style={{ height: "100%" }}>
<ScrollView
style={{ flexGrow: 0 }}
>
<View>
<Title>{messageTitle}</Title>
<MessageBody>{messageBody}</MessageBody>
</View>
</ScrollView>
</View>
const MessageBody = styled(Text)`
color: #2d3e58;
text-align: right;
align-self: center;
width: 90%;
`;
中使用这个组件
我在message-widget-card
<RBSheet
ref={helpSheet}
closeOnDragDown={true}
closeOnPressMask={true}
height={hp(60)}
customStyles={{
wrapper: {
backgroundColor: "rgba(52,52,52,0.8)",
},
draggableIcon: {
backgroundColor: "#d3d6dc",
},
container: {
borderRadius: 15,
},
}}
>
<Container>
<HelpComponentContainer
isHelpForMessage={true}
messageTitle={helpMessageTitle}
messageBody={helpMessage}
/>
</Container>
</RBSheet>
:--我已经尝试过这个。
但卷轴不起作用。
只是我希望蓝色标题应该是粘性的并且正文可以滚动。
我该如何解决这个问题?
谢谢!!
i have small issue with scrollview.
i want to the title become sticky and the after the title means the messageBody become scrollable.
i have tried below one for this implementation.
HelpComponentContainer:---
<View style={{ height: "100%" }}>
<ScrollView
style={{ flexGrow: 0 }}
>
<View>
<Title>{messageTitle}</Title>
<MessageBody>{messageBody}</MessageBody>
</View>
</ScrollView>
</View>
const MessageBody = styled(Text)`
color: #2d3e58;
text-align: right;
align-self: center;
width: 90%;
`;
i am using this component in
message-widget-card:--
<RBSheet
ref={helpSheet}
closeOnDragDown={true}
closeOnPressMask={true}
height={hp(60)}
customStyles={{
wrapper: {
backgroundColor: "rgba(52,52,52,0.8)",
},
draggableIcon: {
backgroundColor: "#d3d6dc",
},
container: {
borderRadius: 15,
},
}}
>
<Container>
<HelpComponentContainer
isHelpForMessage={true}
messageTitle={helpMessageTitle}
messageBody={helpMessage}
/>
</Container>
</RBSheet>
i have tried this one.
But the scroll is not working.
just i want the Blue color title should be sticky and the body become scrollable.
How can i resolve this issue?
Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试像这样实现将标题保留在 ScrollView 之外。
Try to implement like this keep the title outside ScrollView.