我正在使用Android Studio Canary 12进行Jetpack编写练习,并且一切正常,但是最近我更新到了Canary 13,并且还相应地将了撰写版本更新到了最新版本,即alpha04和其他依赖项。现在,当我尝试按Ctrl键并将鼠标悬停在默认的可组合函数上时,其中大多数都不会突出显示,当我按Ctrl键并单击以查看方法实现时,它也显示如下。我做错了什么问题?

package androidx.compose.foundation

private val TextStyleAmbient: androidx.compose.runtime.ProvidableAmbient<androidx.compose.ui.text.TextStyle> /* compiled code */

@androidx.compose.runtime.Composable public fun ProvideTextStyle(value: androidx.compose.ui.text.TextStyle, children: @androidx.compose.runtime.Composable() () -> kotlin.Unit): kotlin.Unit { /* compiled code */ }

@androidx.compose.runtime.Composable public fun Text(text: androidx.compose.ui.text.AnnotatedString, modifier: androidx.compose.ui.Modifier /* = compiled code */, color: androidx.compose.ui.graphics.Color /* = compiled code */, fontSize: androidx.compose.ui.unit.TextUnit /* = compiled code */, fontStyle: androidx.compose.ui.text.font.FontStyle? /* = compiled code */, fontWeight: androidx.compose.ui.text.font.FontWeight? /* = compiled code */, fontFamily: androidx.compose.ui.text.font.FontFamily? /* = compiled code */, letterSpacing: androidx.compose.ui.unit.TextUnit /* = compiled code */, textDecoration: androidx.compose.ui.text.style.TextDecoration? /* = compiled code */, textAlign: androidx.compose.ui.text.style.TextAlign? /* = compiled code */, lineHeight: androidx.compose.ui.unit.TextUnit /* = compiled code */, overflow: androidx.compose.ui.text.style.TextOverflow /* = compiled code */, softWrap: kotlin.Boolean /* = compiled code */, maxLines: kotlin.Int /* = compiled code */, inlineContent: kotlin.collections.Map<kotlin.String, androidx.compose.foundation.text.InlineTextContent> /* = compiled code */, onTextLayout: (androidx.compose.ui.text.TextLayoutResult) -> kotlin.Unit /* = compiled code */, style: androidx.compose.ui.text.TextStyle /* = compiled code */): kotlin.Unit { /* compiled code */ }

@androidx.compose.runtime.Composable public fun Text(text: kotlin.String, modifier: androidx.compose.ui.Modifier /* = compiled code */, color: androidx.compose.ui.graphics.Color /* = compiled code */, fontSize: androidx.compose.ui.unit.TextUnit /* = compiled code */, fontStyle: androidx.compose.ui.text.font.FontStyle? /* = compiled code */, fontWeight: androidx.compose.ui.text.font.FontWeight? /* = compiled code */, fontFamily: androidx.compose.ui.text.font.FontFamily? /* = compiled code */, letterSpacing: androidx.compose.ui.unit.TextUnit /* = compiled code */, textDecoration: androidx.compose.ui.text.style.TextDecoration? /* = compiled code */, textAlign: androidx.compose.ui.text.style.TextAlign? /* = compiled code */, lineHeight: androidx.compose.ui.unit.TextUnit /* = compiled code */, overflow: androidx.compose.ui.text.style.TextOverflow /* = compiled code */, softWrap: kotlin.Boolean /* = compiled code */, maxLines: kotlin.Int /* = compiled code */, onTextLayout: (androidx.compose.ui.text.TextLayoutResult) -> kotlin.Unit /* = compiled code */, style: androidx.compose.ui.text.TextStyle /* = compiled code */): kotlin.Unit { /* compiled code */ }

@androidx.compose.runtime.Composable @androidx.compose.runtime.ComposableContract public fun currentTextStyle(): androidx.compose.ui.text.TextStyle { /* compiled code */ }

最佳答案

Leland Richardson在this上发布的推文中说:“这是Android Studio Canary 13的一个已知问题,所有GMaven的jar都无法正确附加其来源。与撰写无关,但由于使用compose的人们被迫使用AS Canary,因此比例过高影响写作。人们正在研究它”
编辑:发布后,我下载了AS Canary 11,打开了项目,并检查了实现代码。比起我关闭Canary 11并打开Canary 13来解决问题。但是我注意到我无法使缓存/重新启动无效,因为问题再次出现。

关于android-studio - Jetpack Compose方法的实现未显示(Ctrl不会突出显示悬停的功能),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/64184488/

10-09 06:51