Android Studio模板Live Templates(常用)定製 下

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就好了

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章