移动开发平台 mPaaS 使用外部资源

By | 2021年4月23日

使用原生外部资源

在 mPaaS Inside 功能提供整合的情况下,您使用资源非常方便,像其他原生工程一样,只用在依赖中引入您需要的组件。

  
  1. dependencies {
  2. implementation "com.android.support:appcompat-v7:$support_version"
  3. }

使用的时候,按照原生工程一样即可。

  
  1. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2. xmlns:aui="http://schemas.android.com/apk/res/com.alipay.mobile.antui"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. android:orientation="vertical">
  6. <TextView
  7. android:id="@+id/title_atb"
  8. android:layout_width="match_parent"
  9. android:layout_height="wrap_content" />
  10. </LinearLayout>

使用 mPaaS 资源(例如 antui)

使用 antui 的时候,您还是需要依照原先提供的方式引用,例如,在xml中使用,需要为 antui 增加前缀。

  
  1. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2. xmlns:aui="http://schemas.android.com/apk/res/com.alipay.mobile.antui"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. android:orientation="vertical">
  6. <com.alipay.mobile.antui.basic.AUTitleBar
  7. android:id="@+id/title_atb"
  8. aui:rightIconResid="@com.mpaas.demo.sharedres:drawable/titlebar_right"
  9. android:layout_width="match_parent"
  10. android:layout_height="wrap_content" />
  11. </LinearLayout>

请关注公众号获取更多资料

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注