At the moment I am trying to set the position of my programmatically created view using the following code:
LayoutParams params = bottomBar.getLayoutParams();
params.height = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,(float) 5, getResources().getDisplayMetrics());
params.width = LayoutParams.MATCH_PARENT;
bottomBar.setLayoutParams(params);
bottomBar.setLeft(0);
bottomBar.setTop(this.getHeight()-bottomBar.getHeight());
THE PROBLEM
The error I get is that I cant use the setLeft
and setTop
properties in api levels less than 11.
THE QUESTION
How do I programmatically set the position of the view in API level < 11