开发者

How to resize a ScrollView

开发者 https://www.devze.com 2023-03-28 11:28 出处:网络
I have a ScaleDetector in which I zom in my ImageView when it detect a scale movement. This works, the image is well scaled.

I have a ScaleDetector in which I zom in my ImageView when it detect a scale movement. This works, the image is well scaled. But the problems is that my ImageView is in a ScrollView, and the ScrollView doesn't resized itself when I scale. So when my imageView is scaled, I can move on it in the first limits of my ScrollView, not beyond. And of course, the SrollView doestn't have an "setMatrix" or something like that which could allow me to easilly resized it. So how 开发者_Go百科can I do to resize my ScrollView ?


First solution I can think of is, in your java code insert :

scroller = (ScrollView) this.findViewById(R.id.scroller);
scroller.setLayoutParams(new LinearLayout.LayoutParams(width, height));

Then adjust width and height according to your scale.

0

精彩评论

暂无评论...
验证码 换一张
取 消