问题
So I'm using the example on Android Developers to implement pinch to zoom on my Activity.
Im Scaling A Custom View which has a ScrollView(and other things) inside it.
When im scaling, only the actual displayed Screen gets resized - but i want the scaled down things to show more of their content, because they have more space to do so when scaled down. I want them to use all the full screen space.
My Custom Views ondraw method just looks like this:
public void draw(Canvas canvas) {
canvas.scale(mScaleFactor, mScaleFactor);
super.draw(canvas);
}
this is what it looks like right now

If anything is unclear, just leave a comment. Any Help is appreciated edit: i made my custom View another Background color and now i see that my View is still full screen just not the childs.
回答1:
Try forcing the size of the view that is being scaled with a LayoutParams
.
This thread has more detail on how to do this.
回答2:
I am Assuming you are having other layouts apart from your ScrollView which are in Horizontal Orientation or Vertical. Try using weight option in the XML Attributes of ScrollView with a value of 1.0, it might solve your problem.
来源:https://stackoverflow.com/questions/12722300/canvas-scale-on-android-redraw-full-screen