hjw
2023-04-20 a75addbc22f25b5fb219d3979f7bcd9cbf4942c3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.jwipc.nodka_alarmpower;
 
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.NumberPicker;
 
public class My_NumberPicker extends NumberPicker{
 
   public My_NumberPicker(Context context) {
        super(context);
    }
 
    public My_NumberPicker(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
 
    public My_NumberPicker(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }
    
    public void addView(View child) {
        super.addView(child);
        updateView(child);
    }
 
    public void addView(View child, int index,
                        android.view.ViewGroup.LayoutParams params) {
        super.addView(child, index, params);
        updateView(child);
    }
 
    public void addView(View child, android.view.ViewGroup.LayoutParams params) {
        super.addView(child, params);
        updateView(child);
    }
 
    public void updateView(View view) {
        if (view instanceof EditText) {
            Log.i("xiaozhenhe", "getTop = "+My_NumberPicker.this.getTop());
            Log.i("xiaozhenhe", "getBottom = "+My_NumberPicker.this.getBottom());
        }
    }
    
    
    
 
}