Can we use xml layout inflation in KMM (Kotlin Multiplatform Mobile)?

597 Views Asked by At

Are we allowed to use XML layout in KMM? Does using XML in KMM will affect its functionality? When I create a project for KMM, Android Studio automatically creates using Jetpack Compose. Does it mean that we can only or should use jetpack compose for KMM?

in places like setContentView(R.layout.activity_main)

LayoutInflater inflater = (LayoutInflater)getApplicationContext().getSystemService (Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.new_layout,null);

etc

1

There are 1 best solutions below

0
Halifax On BEST ANSWER

Of course you can use XML, the kmm framework just shares common business logic code, not shared UI。

Android platform you can still use xml, IOS platform you can choose swift or object c。