[英]Difference between CustomTextView as Parent and Textview as Parent
我創建了 CustomTextview 如下
public class CustomTextView extends AppCompatTextView {
public CustomTextView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
// im changing font family here .ttf files
}
}
.
<com.android.app.CustomTextView
android:id="@+id/view”
/>
有什么區別
這個
CustomTextView textView = findViewbyId(R.id.view);
和這個
TextView textView = findViewbyId(R.id.view);
當我把這個TextView textView = findViewbyId(R.id.view);
IDE 運行時沒有拋出錯誤。 為什么? 謝謝!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.