如果我有一個簡單的自定義視圖:Kotlin Android Extensions是否會緩存綜合屬性或每次調用findViewById()?
myitem.xml
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="@+id/textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<FrameLayout/>
訪問一個kotlinx syntentic屬性:
import kotlinx.android.synthetic.main.myitem.view.*
view.toolbar.text = "Some text"
內部,它產生於findByViewID()
通話。所以我的問題是:
結果爲自定義視圖緩存像活動或每次每個時間被調用findByViewID
?由於性能原因,答案非常重要。
該提案是否完全在1.1.4中實現? – WindRider
是的。閱讀1.1.4發行說明 – deviant
我做了,但我並不完全確定。 – WindRider