Im trying to figure out how to align the view in a relative layout in the upper right corner. It is currently aligned in the upper left corner.
A simple problem, but I do not know how to do this.
Here is the code:
RelativeLayout.LayoutParams gpsViewLayoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT ); gpsViewLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP); gpsViewLayoutParams.addRule(RelativeLayout.ALIGN_RIGHT); this.relativeLayout.addView(gpsView,gpsViewLayoutParams);
source share