Android的飞行在菜单阴影 [英] Android fly-in menu shadow

查看:99
本文介绍了Android的飞行在菜单阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在玩弄几个不同的库和code片段在过去的几天。我想创建一个在Facebook的应用程序看到的菜单。
现在有建设那样的东西很多库和资源,但我在画中的'顶'和'底部'页面,创造的幻觉之间的阴影主要困难是,'顶'页面实际上是在顶部。
现在,我试着去创造确切的疗效,显示这篇文章在:
http://android.cyrilmottier.com/?p=717

I have been toying with a few different libraries and code snippets for the past few days. I am trying to create a menu like the one seen in the facebook app. Now there are many libraries and resources on building something of that kind, but I'm having major difficulties in drawing a shadow between the 'top' and 'bottom' page as to create the illusion that the 'top' page is actually on top. Now the exact effect Im trying to create is displayed in this article: http://android.cyrilmottier.com/?p=717

我得到这个从文章的作者是不是他的解释很彻底。这可能是由于我的编程技能,发展不足,或者也许我不是唯一的一个。
我使用下面库和示例应用程序进行测试,并与发展:
https://github.com/jfeinstein10/SlidingMenu

The author of the article I got this from is not very thorough in his explanation. This could be due to my programming-skills-under-development, or maybe I'm not the only one. I'm using the following library and example app to test and develop with: https://github.com/jfeinstein10/SlidingMenu

我会非常高兴,如果有人可以帮助我得到这个工作。

I would be very happy if anyone could help me get this to work.

PS:我很抱歉,但因为我在这里是个新手,我不允许张贴任何图片

PS: I'm very sorry, but since I'm a newbie here I am not allowed to post any pictures.

推荐答案

我所做的是我把一个影子在我的菜单视图(即behindView)的右边有一个保证金在你的上述观点的权利:

What I did is I'm putting a shadow at the right of my menu view (ie behindView) with a margin on the right of your above view :

<!-- Show shadow on the right of the menu -->
    <RelativeLayout 
        android:id="@+id/menuShadow"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:focusable="false"
        android:clickable="false"
        android:background="#00000000"
        android:layout_marginRight="40dp">
        <ImageView 
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:layout_alignParentBottom="true"
            android:layout_width="6dp"
            android:layout_height="fill_parent"
            android:background="@layout/border_menu_progressive_shadow"/>
    </RelativeLayout>

使用我的影子布局:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item>
        <shape>
            <gradient
                android:startColor="#00101010"
                android:endColor="#252525"
                android:angle="0" />
        </shape>
    </item>

</selector>

这篇关于Android的飞行在菜单阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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