有没有办法在 macOS Sonoma 上运行 xcode 14?不小心升级了系统,无法发布官方项目
我的目的是使用jarsigner来签署apk。
\n我得到以下提示\xef\xbc\x9a
\n% jarsigner \nThe operation couldn\xe2\x80\x99t be completed. Unable to locate a Java Runtime that supports jarsigner.\nPlease visit http://www.java.com for information on installing Java.\nRun Code Online (Sandbox Code Playgroud)\n我的java版本提示\xef\xbc\x9a
\n% java -version\njava version "1.8.0_321"\nJava(TM) SE Runtime Environment (build 1.8.0_321-b07)\nJava HotSpot(TM) 64-Bit Server VM (build 25.321-b07, mixed mode)\nRun Code Online (Sandbox Code Playgroud)\nMac版本是11.6.3
\n请问我该如何解决这个问题?
\n我想动态传送内容并显示超链接,但它不能动态传送并且不能工作
\nlet linkTitle = "Apple Link"\nlet linkURL = "http://www.apple.com"\nlet string = "[Apple Link](http://www.apple.com)"\n \nText(string) // Not working\n\nText("[Apple Link](http://www.apple.com)") // Working\n \nText("[\\(linkTitle)](http://www.apple.com)") // Working\n \nText("[\\(linkTitle)](\\(linkURL))") // Not working\n \nRun Code Online (Sandbox Code Playgroud)\n val queue = navController.backQueue
backQueue成为私有的androidx.navigation:navigation-runtime:2.6.0-alpha07@aar
有替代品吗?
我需要更新用户配置文件开关
\nclass ProfileViewModel : BaseViewModel() {\n\n var greet = mutableStateOf(user.pushSetting.greet)\n var message = mutableStateOf(user.pushSetting.message)\n var messageDetails = mutableStateOf(user.pushSetting.messageDetails)\n\n var follow = mutableStateOf(user.pushSetting)\n var like = mutableStateOf(user.pushSetting.like)\n var comment = mutableStateOf(user.pushSetting.comment)\n\n fun updateUser() {\n println("--")\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n2.可组合性
\n@Composable\nfun SettingCard(viewModel: ProfileViewModel) {\n\n Lists {\n Section {\n TextRow(text = "\xe6\x89\x8b\xe6\x9c\xba\xe5\x8f\xb7\xe7\xa0\x81") { }\n TextRow(text = "\xe4\xbf\xae\xe6\x94\xb9\xe5\xaf\x86\xe7\xa0\x81", line = false) { }\n }\n\n Section {\n SwitchRow(text = "\xe6\x96\xb0\xe5\xa5\xbd\xe5\x8f\x8b\xe9\x80\x9a\xe7\x9f\xa5", checkedState = viewModel.greet)\n SwitchRow(text = "\xe6\x96\xb0\xe6\xb6\x88\xe6\x81\xaf\xe9\x80\x9a\xe7\x9f\xa5", checkedState = viewModel.message)\n SwitchRow(text …Run Code Online (Sandbox Code Playgroud) 我有 A、B 和 C 三个页面,通过导航顺序访问这三个页面。
\nA -> B -> C
\n如何从C返回A?
\n这些官方描述应该有用,但是don\xe2\x80\x99不懂。
\n// Pop everything up to the "home" destination off the back stack before\n// navigating to the "friends" destination\nnavController.navigate(\xe2\x80\x9cfriends\xe2\x80\x9d) {\n popUpTo("home")\n}\n\n// Pop everything up to and including the "home" destination off\n// the back stack before navigating to the "friends" destination\nnavController.navigate("friends") {\n popUpTo("home") { inclusive = true }\n}\n\n// Navigate to the "search\xe2\x80\x9d destination only if we\xe2\x80\x99re not already on\n// the "search" destination, avoiding multiple copies on …Run Code Online (Sandbox Code Playgroud) 如本页所述,可以通过R8/Proguard删除未引用的图标,如何删除它们?
https://developer.android.google.cn/reference/kotlin/androidx/compose/material/icons/package-summary
我的目的是自动对焦和移除焦点。
第一次启动的页面可以自动获得焦点,但是如果推送到下一个页面,就会自动失败。
这样工作
struct SearchTextFieldView: View {
@FocusState var focused: Field?
@State var username: String = ""
enum Field: Int, Hashable {
case name
}
var body: some View {
NavigationView {
VStack {
Button {
focused = nil
} label: {
Text("Remove Focuse")
}
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
focused = .name
}
}
}
.toolbar {
ToolbarItem(placement: .principal) {
TextField("user name", text: $username)
.focused($focused, equals: .name)
.disableAutocorrection(true)
.padding(4)
.border(.secondary)
}
}
.navigationBarTitleDisplayMode(.inline)
}
}
}
Run Code Online (Sandbox Code Playgroud)
推送到下一页不起作用 …
我们知道下面的创建实例的方式非常好,可以享受生命周期管理。在 ViewModel 中创建的实例是相同的。
但如果想在一个页面上创建两个实例,该如何创建呢?
fun Following(viewModel: FollowViewModel = viewModel()) {
}
Run Code Online (Sandbox Code Playgroud) LaunchedEffect变化value是实施println
但是为什么第一次进入默认的时候也执行呢value,真是让人费解,为什么要这样设计呢。
\nLaunchedEffect(value) {\n println("--1--")\n}\n\nRun Code Online (Sandbox Code Playgroud)\n如何避免第一次执行\xef\xbc\x9f
\n