I'm having trouble scaling an imageview in java in the Android SDK. I feel like this should be a relatively simple task but I can't seem to find an answer online that isn't using features that have been deprecated or otherwise appear overly complex.
For my app I want to put in the image of a stone column on the left side of the screen - right up against the edge. I want to scale the image so that the top of the column hits the top of the screen, and the bottom of the column touches the bottom of the screen. Here is my code as far as I know how to do it:
relativeLayout= new RelativeLayout(this);
ImageView column1= new ImageView(this);
column1.setImageResource(R.drawable.background_column_right);
RelativeLayout.LayoutParams column_dimensions = new RelativeLayout.LayoutParams(width/5, height);
column1.setLayoutParams(column_dimensions);
relativeLayout.addView(column1);
setContentView(relativeLayout);
The problem with this is that I cannot specify the scaling to be in proportion with the size of the image. For some reason I cannot seem to figure out a way to accurately detect the scale of my image.
When I run my program the column image does not scale to fill the scaling imageview.