/**
* 拖動View 配合onTouchListener使用
* 設置View的布局屬性,使得view隨着手指移動 注意:view所在的布局必須使用RelativeLayout 而且不得設置居中等樣式
*
* @param view
* @param rawY
*/
private void moveViewWithFinger(View view, float rawY ,int statusBar) {
if (rawY> view.getHeight()){
rawY = view.getHeight() + statusBar;
}
int left = 0;
int top = (int) rawY - mProfile.getHeight();
int width = view.getWidth();
int height = top + view.getHeight();
view.layout(left, top, width, height);
}