当控件过小时,很难准确地点击。此时可以利用TouchDelegate扩大控件点击范围。
使用步骤:
- 获取控件当前点击范围
- 计算扩大后的点击范围
- 应用扩大后的点击范围
示例:
| import android.content.Context; | |
| import android.graphics.PointF; | |
| import android.support.annotation.NonNull; | |
| import android.support.annotation.Nullable; | |
| import android.support.v4.view.GestureDetectorCompat; | |
| import android.util.AttributeSet; | |
| import android.view.GestureDetector; | |
| import android.view.MotionEvent; | |
| import android.view.ScaleGestureDetector; | |
| import android.view.View; |
常见的滑动冲突主要分三种:
解决方案:
MVC的关键点在于:
I'd like to share my idea about this difference. Both component and module are used to refer to a group of functions or a part of a function. Module is more logical, for example: module Finance, module HR, module Manufacturing... ... On the other hand, component is more physical. In software, it can be a dll, ocx, exe,...