android圆形画廊? [英] android circular gallery?

查看:32
本文介绍了android圆形画廊?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是android开发的新手.现在我想做如下图所示的圆形画廊视图.问题是当用户从左到右和从右到左滚动时,我想放大中心图像.有相关教程吗?

I am a newbie to android development.Now i would like to do gallery view as circular like image as below.The things is that i want to enlarge the center image when user scroll from left to right and right to left. Is there any tutorials for that ?

我想要的是被刷过的图像需要在它在中心时放大.我以为我可以用 Gallery 做到这一点.但 android 开发者的例子不是我想要的.:(

what I want is the image that's been swiped need to be enlarged while it's at the center. I thought I could do it with Gallery. but the example from the android developer is not the one I want. :(

推荐答案


如果您想放大中心选定的图像,有一种可能的方法.在您的 onItemSelected 方法上,只需调用动画即可缩放对象.Gallery 的特性是它始终处于中心锁定状态.所以中心元素将始终被选中.希望这会奏效..


If you want to enlarge the center selected image there is one possible way. On your onItemSelected method, just call an animation to zoom the object. The property of gallery is that it is always center-locked. So the center element will be always selected. Hope that will work..

<?xml version="1.0" encoding="utf-8"?>
<set
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="false"
    android:fillAfter="true"
>
<scale 
       android:fromXScale="1.0"
       android:toXScale="1.50"
       android:fromYScale="1.0"
       android:toYScale="1.50"
       android:duration="600"
       android:pivotX="50%"
       android:pivotY="50%"
       android:fillAfter="true"/>

</set>

请记住,您必须存储之前的视图,因为当元素远离中心时,它应该被放置到正常大小.

Do remember that you will have to store the previous view as when the element is move away from center it should be put to the normal size.

所以你可以有两个视图 - prevView 和 currView.
在 currView 上做动画.

So you can have two views - prevView and currView.
Do the animation on the currView.

谢谢,

这篇关于android圆形画廊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆