Android is an example of castom View that works



  • Examples http://developer.android.com/intl/ru/training/custom-views/index.html The reference doesn't work.

    We need the best heir. viewwithout additional parameters, I'm not starting to initial it. layoutHuh.

    You can get the minus.



  • https://developer.android.com/intl/ru/training/custom-views/index.html :

    class PieChart extends View {
        public PieChart(Context context, AttributeSet attrs) {
            super(context, attrs);
        }
    }
    

    Use:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
       xmlns:custom="http://schemas.android.com/apk/res/com.example.customviews">
       <com.example.customviews.charting.PieChart/>
    </LinearLayout>
    

    Where? com.example.customviews.charting - the name of the package in which your class is. What can be done wrong, not clear.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2