【问题标题】:android image gallery similar to iphone music gallery类似于 iphone 音乐库的 android 图像库
【发布时间】:2014-05-22 05:34:55
【问题描述】:

我正在开发一个应用程序,该应用程序将以类似画廊的方式显示图像。画廊有两种模式,具体取决于设备的方向。如果是肖像,那将非常容易,因为图像应该只显示在网格中(可能会为此使用GridView)。在横向模式下,图片库将显示类似于 iPod 音乐库的内容,如下所示..

我需要的几乎与此相似,除了左/右显示的图像缩略图没有倾斜(或者如果它倾斜无关紧要,只需让它看起来相似并与 iPod/ 的画廊相似) iPhone)

我已经搜索了几个网站并用谷歌搜索了它,但几乎所有返回的都是移动网络,而且由于我没有为 Android 开发者使用移动网络,当然我看到的那些是不可用的。任何已知的第三方图书馆都可以从事这种工作?谢谢!

【问题讨论】:

    标签: android image landscape image-gallery photo-gallery


    【解决方案1】:

    试试这个..

    参考下面两个例子

    示例 1:

    在您的 Android 应用中使用 FancyCoverFlow 就像

    fancyCoverFlow = new FancyCoverFlow(context);
    fancyCoverFlow.setMaxRotation(45);
    fancyCoverFlow.setUnselectedAlpha(0.3f);
    fancyCoverFlow.setUnselectedSaturation(0.0f);
    fancyCoverFlow.setUnselectedScale(0.4f);
    

    您还可以从 XML 中扩充 FancyCoverFlow:

    <at.technikum.mti.fancycoverflow.FancyCoverFlow
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            fcf:maxRotation="45"
            fcf:unselectedAlpha="0.3"
            fcf:unselectedSaturation="0.0"
            fcf:unselectedScale="0.4" />
    

    示例如下

    https://github.com/davidschreiber/FancyCoverFlow

    示例 2:

    final CoverFlow coverFlow1 = (CoverFlow) findViewById(this.getResources().getIdentifier("coverflow", "id",
                    "pl.polidea.coverflow"));
     setupCoverFlow(coverFlow1, false);
     final CoverFlow reflectingCoverFlow = (CoverFlow) findViewById(this.getResources().getIdentifier(
                    "coverflowReflect", "id", "pl.polidea.coverflow"));
     setupCoverFlow(reflectingCoverFlow, true);
    

    XML

    <pl.polidea.coverflow.CoverFlow xmlns:coverflow="http://schemas.android.com/apk/res/pl.polidea.coverflow"
    coverflow:imageWidth="100dip" coverflow:imageHeight="150dip" coverflow:withReflection="true"
    coverflow:imageReflectionRatio="0.2" coverflow:reflectionGap="2dip" android:id="@+id/coverflowReflect"
    android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5dip" />
    

    示例如下

    https://github.com/Polidea/android-coverflow

    【讨论】:

    • 感谢您的回答!有很大帮助!即便如此,只是提到那种称为coverflow的UI元素确实有所作为。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多