Android JetPack组成:浏览文本字段
我实现了一个具有很多文本场的屏幕,并将脚手架用作根层。 因为我希望我的屏幕是RTL,所以我使用了构图本地提供商()。
CompositionLocalProvider(LocalLayoutDirection provides LayoutDirection.Rtl ) {}
我的文本场在屏幕上像这样:
BA
DC
,当我想浏览这些Textfields时:
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Next),
keyboardActions = KeyboardActions(
onNext = { LocalFocusManager.current.moveFocus(FocusDirection.Next) }
)
我希望发生的事情:a - > b - > c - > D
发生了什么:b - > a - > D - > c
(我为父词使用了一个列,但文本字段的行作为父根二乘两个(排在列中))
有人可以帮忙吗? 谢谢。
I implemented a screen that has a lot of TextFields and I used the scaffold as a root layer.
Because I wanted my screen to be rtl, I used Composition Local provider().
CompositionLocalProvider(LocalLayoutDirection provides LayoutDirection.Rtl ) {}
My TextFields were on the screen like this:
B A
D C
and when I wanted to navigate through these TextFields:
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Next),
keyboardActions = KeyboardActions(
onNext = { LocalFocusManager.current.moveFocus(FocusDirection.Next) }
)
what I Expected to happend: A -> B -> C -> D
what happend: B -> A -> D -> C
(I used a Column for parent root but textfields have Row as Parent root two by two (the Rows are in Column))
Can anyone help?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
.focusorder
修饰符来实现这一目标:You can use
.focusOrder
modifier to achieve this: