Custom Components
Custom Components:自訂組件。
自訂組件步驟
1.建新的project。
2.新建 attrs.xml 在 res/values 。
3.新建 mainactivity.java 在 res 。
4.修改activity_main.xml在 res/layout 。記得改掉packagename。
例如:在activity_main.xml 裡面要定義新的元件(Components) 要改掉packagename。
<com.example.android.custom_component.TimeView
紅色字是要複製此APP的package name,一定要跟此APP 的package name一致,才可以執行。
例如:在activity_main.xml 裡面要定義新的元件(Components) 要改掉packagename。
<com.example.android.custom_component.TimeView
紅色字是要複製此APP的package name,一定要跟此APP 的package name一致,才可以執行。
5.跑程式看結果。
參考文獻:
Custom Components
https://www.tutorialspoint.com/android/android_custom_components.htm
Android自定義組件
http://www.w3ii.com/zh-TW/android/android_custom_components.html
客製化元件 (Building Custom Component) 入門
http://edscb.blogspot.tw/2013/04/building-custom-component.html
Android Custom View
http://yume190.github.io/2014/09/01/Android-2014-09-01-android-custom-view/
Custom Components
https://www.tutorialspoint.com/android/android_custom_components.htm
Android自定義組件
http://www.w3ii.com/zh-TW/android/android_custom_components.html
客製化元件 (Building Custom Component) 入門
http://edscb.blogspot.tw/2013/04/building-custom-component.html
Android Custom View
http://yume190.github.io/2014/09/01/Android-2014-09-01-android-custom-view/
沒有留言:
張貼留言