gpt4 book ai didi

Compose Multiplatform vs Jetpack Compose on Android(多平台组合VS Jetpack组合安卓)

转载 作者:bug小助手 更新时间:2023-10-28 10:55:57 24 4
gpt4 key购买 nike



I understand that Compose Multiplatform, when used for iOs, is not SwiftUI.
But what about when using Compose Multiplatform in KMM, is Compose Multiplatform on Android the same as the original Jetpack Compose on Android?

我知道Compose MultiPlatform在iOS上使用时,不是SwiftUI。但是当在KMM中使用Compose多平台时,Android上的Compose多平台与Android上最初的Jetpack Compose是一样的吗?


更多回答
优秀答案推荐

Jetpack Compose is a modern Android UI toolkit developed by Google for building native user interfaces in a declarative way. It's primarily focused on Android app development and allows developers to create UIs using Kotlin programming language.

Jetpack Compose是一个由Google开发的现代Android用户界面工具包,用于以声明的方式构建本地用户界面。它主要专注于Android应用程序开发,允许开发人员使用Kotlin编程语言创建用户界面。


Compose Multiplatform, on the other hand, refers to the capability of using Jetpack Compose for UI development in multiplatform projects. Kotlin Multiplatform (KMP) is a technology that allows you to share code between multiple platforms, such as Android, iOS, and even web applications, using Kotlin. Compose Multiplatform extends Jetpack Compose to work in multiplatform projects, enabling you to create user interfaces that can be shared across different platforms.

另一方面,Compose多平台指的是在多平台项目中使用Jetpack Compose进行UI开发的能力。Kotlin多平台(KMP)是一种允许您使用Kotlin在多个平台(如Android、iOS甚至Web应用程序)之间共享代码的技术。Compose MultiPlatform扩展了Jetpack Compose以在多平台项目中工作,使您能够创建可跨不同平台共享的用户界面。


With Compose Multiplatform, you can write UI code once in Kotlin using Jetpack Compose and use it across Android and other supported platforms, which can help in code sharing and consistency across different platforms.

使用Compose多平台,您可以使用Jetpack Compose在Kotlin中编写一次UI代码,并在Android和其他支持的平台上使用它,这有助于跨不同平台的代码共享和一致性。



Answer is yes. JetBrain’s Compose Multiplatform based on Jetpack Compose, shares most of its API with Jetpack Compose and use Jetpack Compose elements for Android. So for Android development there is almost no difference between using Jetpack Compose and Compose Multiplatform. Please take a look at GitHub repo.

答案是肯定的。JetBrain的Compose多平台基于Jetpack Compose,与Jetpack Compose共享其大部分API,并为Android使用Jetpack Compose元素。因此,对于Android开发来说,使用Jetpack Compose和Compose多平台几乎没有区别。请看GitHub回购。


更多回答

Does Compose Multiplatform really extends Jetpack Compose technically, in the object orientated sense? That's not so clear to me yet.

在面向对象的意义上,ComposeMultiplatform真的在技术上扩展了JetpackCompose吗?我还不太清楚

@stefan.at.kotlin Yes, in object orientated sense.

@stefan.at.kotlin是的,在面向对象的意义上。

Wanna add that there is literally zero difference for Android, medium.com/@jacobras/…

我想补充的是,对于安卓系统来说,Medium.com/@Jacobras/…几乎没有区别

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com