get Center Of View - Android User Interface

Android examples for User Interface:View Center

Description

get Center Of View

Demo Code


//package com.java2s;

import android.view.View;

public class Main {
    public static int getCenterOfView(View view) {
        return view.getLeft() + view.getWidth() / 2;
    }//  w ww.j  a  v  a 2  s  . c o m
}

Related Tutorials