0.接着上篇讲(图0)
1.kotlin 生成start
图0中3的位置输入
companion object {
fun start(context: android.content.Context) {
val intent = android.content.Intent(context, $ACTIVITY$::class.java)
context.startActivity(intent)
}
}
在其下方点击Change选择 kotlin
点击图0中4的位置 Edit variables,把 ACTIVITY 替换成kotlinClassName,点OK就好了
2.ScrollView LinearLayout 配套生成
图0中3的位置输入
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</LinearLayout>
</ScrollView>
在其下方点击Change选择 XML,点OK就好了
3.LinearLayout中横向占位View
图0中3的位置输入
<View
android:layout_width="0dp"
android:layout_height="1px"
android:layout_weight="1"/>
在其下方点击Change选择 XML,点OK就好了