未解决的参考:Compose for Desktop 中的 ExposedDropdownMenuBox
Unresolved reference: ExposedDropdownMenuBox in Compose for Desktop
我需要为 Windows 应用实现一个基于 Compose for Desktop
的下拉菜单
为此,我正在尝试使用 ExposedDropdownMenuBox
但我收到错误消息:
Unresolved reference: ExposedDropdownMenuBox
代码如下:
ExposedDropdownMenuBox(
expanded = expanded,
onExpandedChange = {
expanded = !expanded
}
) {
// TextFeild implementation
}
文件 build.gradle.kts
包含以下内容:
import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.6.10"
id("org.jetbrains.compose") version "1.1.1"
}
group = "com.op.bgmi"
version = "1.0"
repositories {
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
dependencies {
implementation(compose.desktop.currentOs)
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}
compose.desktop {
application {
mainClass = "MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "App"
packageVersion = "1.0.0"
}
}
}
我是不是漏了什么,请指教
在 Compose for Desktop 中使用下拉菜单框的正确方法是什么
我需要为 Windows 应用实现一个基于 Compose for Desktop
的下拉菜单
为此,我正在尝试使用 ExposedDropdownMenuBox
但我收到错误消息:
Unresolved reference: ExposedDropdownMenuBox
代码如下:
ExposedDropdownMenuBox(
expanded = expanded,
onExpandedChange = {
expanded = !expanded
}
) {
// TextFeild implementation
}
文件 build.gradle.kts
包含以下内容:
import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.6.10"
id("org.jetbrains.compose") version "1.1.1"
}
group = "com.op.bgmi"
version = "1.0"
repositories {
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
dependencies {
implementation(compose.desktop.currentOs)
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}
compose.desktop {
application {
mainClass = "MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "App"
packageVersion = "1.0.0"
}
}
}
我是不是漏了什么,请指教
在 Compose for Desktop 中使用下拉菜单框的正确方法是什么