我想添加 LazyColumn 的空白底部,并且我想允许用户调出底部元素。我怎样才能实现这个。
例子;
LazyColumn(
modifier = Modifier.fillMaxWidth().height(300.dp).border(2.dp, Color.Red),
contentPadding = PaddingValues(25.dp)
){
items(7) {
Surface(
modifier = Modifier
.fillMaxWidth()
.height(100.dp),
color = Color.Gray
) {}
Spacer(modifier = Modifier.height(10.dp))
}
}
Run Code Online (Sandbox Code Playgroud)
我想增加 a 的长度
注意:即使到达最后一个元素,我也希望能够向上滚动。
这是我的错误;
This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
The following AndroidX dependencies are detected:
androidx.fragment:fragment:1.0.0,
androidx.versionedparcelable:versionedparcelable:1.0.0,
androidx.slidingpanelayout:slidingpanelayout:1.0.0
...
Run Code Online (Sandbox Code Playgroud)
我怎么解决这个问题?我从我的 gradle 文件和我从类中导入的库中删除了所有 androidx 库。我不想使用androidx。
AnimatedNavHost(navController, startDestination = BottomNavItem.Splash.screen_route){
composable(
signup + "/{emailFromSignIn}" + "/{passwordFromSignIn}",
arguments = listOf(
navArgument("emailFromSignIn"){
type = NavType.StringType
},navArgument("passwordFromSignIn"){
type = NavType.StringType
}
}
Run Code Online (Sandbox Code Playgroud)
navController.navigate(signup + "/$textEmail" + "/$textPassword")
Run Code Online (Sandbox Code Playgroud)
我怎样才能传递一个空字符串?
错误:
在导航图中找不到与请求 NavDeepLinkRequest{ uri=android-app://androidx.navigation/signup// } 匹配的导航目的地 NavGraph(0x0) startDestination={Destination(0xb6b16c34) route=splash}
android kotlin android-jetpack android-jetpack-navigation android-jetpack-compose
我需要在 Text 中实现视觉转换,但不知何故 Text 没有此参数,只有 TextFiled 有此参数。如何找到解决这个问题的方法?
例子;
TextField(
visualTransformation = // have this parameter
)
Text(
visualTransformation = // doesnt have this parameter
)
Run Code Online (Sandbox Code Playgroud)
我需要它,因为我必须显示大十进制包含逗号和点分隔符,并且我对此进行了视觉转换。
这是我的代码;
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
){
Canvas(
modifier = Modifier
.fillMaxSize(0.5f)
.border(1.dp, Color.Red)
){
drawRect(
color =Color.Black,
size = size,
style = Stroke(
width = 100f
)
)
}
}
}
Run Code Online (Sandbox Code Playgroud)
结果;
我希望厚度从红线的内侧或外侧增加,而不是两侧。我怎样才能做到这一点?
android-canvas kotlin android-jetpack-compose android-jetpack-compose-canvas
这是我的例子,我如何在 Kotlin 中做到这一点?
var hashMapForTry = HashMap<String,Int>()
hashMapForTry.put("Hi",5)
hashMapForTry.put("What",7)
hashMapForTry.put("How",2)
hashMapForTry.put("Go",1)
hashMapForTry.put("Ford",9)
Run Code Online (Sandbox Code Playgroud) 我有两个清单;
val keys: List<String> = listOf("key1", "key2", "key3"...)
val values: List<String> = listOf("value1", "value2", "value3"...)
Run Code Online (Sandbox Code Playgroud)
我怎样才能将它们合二为一List<Hashmap<Key,Value>>
?喜欢;
println(List<Hashmap<Key,Value>>)
: [[key1 = value1], [key2 = value2], [key3 = value3]...
kotlin ×6
android ×3
list ×2
android-jetpack-compose-canvas ×1
androidx ×1
collectors ×1
dictionary ×1
gradle ×1
hashmap ×1
sorting ×1
treemap ×1