How to place a UI element in android , if i know its percentage height from bottom or top -


i have make screen in android . , add ui elements . want know there way add element on ui if know @ percentage height bottom element placed . , know size of element in dp , (32dp * 44 dp).

first have calculate height , width of device runtime , according figures need define percentage height , width. can find height , width @ runtime following

    displaymetrics = new displaymetrics();     getwindowmanager().getdefaultdisplay().getmetrics(displaymetrics);     screenheight = displaymetrics.heightpixels;     screenwidth = displaymetrics.widthpixels;   

Comments