带菜单和功能的滑动抽屉

发布于 2024-09-12 00:46:38 字数 6299 浏览 8 评论 0原文

我正在开发一个视频编辑应用程序,在我的 Wildfire 上,相机应用程序使用滑动抽屉进行图像调整,但它不仅列出选项(作为图标),而且当您点击图标时,您可以显示实际功能或调整make 也是滑动抽屉的一部分(见图)。

滑动抽屉 Android Wildfire http://img688.imageshack.us/img688/571/img0431zz。 jpg

我想知道我是否也可以在我的应用程序中做到这一点以及我需要为此做什么。如果有人可以帮助我或者知道这方面的教程,那就太好了。

谢谢。


我仍在处理上述问题,但我的滑块和图标有问题......发生的情况是,当我点击滑块再次关闭抽屉时,所有内容都消失了。 (见下文)

滑块打开: alt 文本 http://img825.imageshack.us/img825 /2087/screenshotslidingdrawer.png 滑块关闭: 替代文本 http://img180.imageshack.us/img180/2087/screenshotslidingdrawer .png

我真的不知道我可能做错了什么......

这就是我到目前为止一直在做的事情:

<?xml version="1.0" encoding="utf-8"?>

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent" 
            android:layout_height="fill_parent"
            android:background="@drawable/shape_background_gradient"
                  >

        <VideoView
            android:layout_width="240px"
            android:layout_height="180px"
            android:id ="@+id/VideoViewEdit"
            android:layout_centerHorizontal="true"
            >
        </VideoView>
        <ScrollView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/VideoViewEdit">
            <TableLayout
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:stretchColumns="0">
                <TableRow
                        android:background="@drawable/shape_track_background"
                        android:padding="5px"
                        >
                    <ImageView android:layout_width="wrap_content"
                               android:layout_height="wrap_content"
                               android:src="@drawable/ic_editor_videotrack"
                               android:padding="5px"
                               android:layout_gravity="left"/>

                </TableRow>
                <TableRow
                        android:background="@drawable/shape_track_background"
                        android:padding="5px"
                        >
                        <ImageView android:layout_width="wrap_content"
                               android:layout_height="wrap_content"
                               android:src="@drawable/ic_editor_audiotrack"
                               android:padding="5px"
                               android:layout_gravity="left"/>


                </TableRow>
                <TableRow
                        android:background="@drawable/shape_track_background"
                        android:padding="5px"
                        >
                    <ImageButton android:layout_width="wrap_content"
                               android:layout_height="wrap_content"
                               android:src="@drawable/ic_editor_add_media"
                               android:padding="5px"
                               android:layout_gravity="left"
                               />
                </TableRow>
            </TableLayout>
        </ScrollView>
 <SlidingDrawer
     android:id="@+id/drawer"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:orientation="horizontal"
     android:handle="@+id/handle"
     android:content="@+id/content">

     <ImageView
         android:id="@id/handle"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:src="@drawable/slider_handle"
         />

     <LinearLayout
         android:id="@id/content"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
         android:orientation="vertical">
        <ImageButton 
            android:id="@+id/button_exposure"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#77000000"
            android:src="@drawable/ic_slider_exposure"
            android:padding="5px"
            android:layout_marginBottom="1px"
            android:layout_gravity="left"/>
        <ImageButton 
            android:id="@+id/button_properties"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#77000000"
            android:src="@drawable/ic_slider_properties"
            android:padding="5px"
            android:layout_marginBottom="1px"
            android:layout_gravity="left"/>
        <ImageButton 
            android:id="@+id/button_special_effects"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#77000000"
            android:src="@drawable/ic_slider_special_effects"
            android:padding="5px"
            android:layout_marginBottom="1px"
            android:layout_gravity="left"/>
        <ImageButton 
            android:id="@+id/button_test1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#77000000"
            android:src="@drawable/ic_slider_exposure"
            android:padding="5px"
            android:layout_marginBottom="1px"
            android:layout_gravity="left"/>
        <ImageButton 
            android:id="@+id/button_test2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#77000000"
            android:src="@drawable/ic_slider_exposure"
            android:padding="5px"
            android:layout_marginBottom="1px"
            android:layout_gravity="left"/>

     </LinearLayout>
 </SlidingDrawer>
</RelativeLayout>

I am working on a video editing app and on my Wildfire the camera app uses a sliding drawer for image adjustments, but it doesn't only list the options (as icons) but when you tap an icon the actual functions or adjustments that you can make are also part of the sliding drawer (see image).

Sliding Drawer Android Wildfire http://img688.imageshack.us/img688/571/img0431zz.jpg

I was wondering if I also could do that in my app and what I would need to do for that. If someone can help me out or maybe knows a tutorial for this, that would be great.

Thank you.


I am still working on the above but I have a problem with my slider and the icons...what happens is that when I tap the slider to close the drawer again everything disappears. (see below)

Slider open: alt text http://img825.imageshack.us/img825/2087/screenshotslidingdrawer.png
Slider closed: alt text http://img180.imageshack.us/img180/2087/screenshotslidingdrawer.png

I don't really know what I may have done wrong...

This is what I have been doing so far:

<?xml version="1.0" encoding="utf-8"?>

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent" 
            android:layout_height="fill_parent"
            android:background="@drawable/shape_background_gradient"
                  >

        <VideoView
            android:layout_width="240px"
            android:layout_height="180px"
            android:id ="@+id/VideoViewEdit"
            android:layout_centerHorizontal="true"
            >
        </VideoView>
        <ScrollView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/VideoViewEdit">
            <TableLayout
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:stretchColumns="0">
                <TableRow
                        android:background="@drawable/shape_track_background"
                        android:padding="5px"
                        >
                    <ImageView android:layout_width="wrap_content"
                               android:layout_height="wrap_content"
                               android:src="@drawable/ic_editor_videotrack"
                               android:padding="5px"
                               android:layout_gravity="left"/>

                </TableRow>
                <TableRow
                        android:background="@drawable/shape_track_background"
                        android:padding="5px"
                        >
                        <ImageView android:layout_width="wrap_content"
                               android:layout_height="wrap_content"
                               android:src="@drawable/ic_editor_audiotrack"
                               android:padding="5px"
                               android:layout_gravity="left"/>


                </TableRow>
                <TableRow
                        android:background="@drawable/shape_track_background"
                        android:padding="5px"
                        >
                    <ImageButton android:layout_width="wrap_content"
                               android:layout_height="wrap_content"
                               android:src="@drawable/ic_editor_add_media"
                               android:padding="5px"
                               android:layout_gravity="left"
                               />
                </TableRow>
            </TableLayout>
        </ScrollView>
 <SlidingDrawer
     android:id="@+id/drawer"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:orientation="horizontal"
     android:handle="@+id/handle"
     android:content="@+id/content">

     <ImageView
         android:id="@id/handle"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:src="@drawable/slider_handle"
         />

     <LinearLayout
         android:id="@id/content"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
         android:orientation="vertical">
        <ImageButton 
            android:id="@+id/button_exposure"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#77000000"
            android:src="@drawable/ic_slider_exposure"
            android:padding="5px"
            android:layout_marginBottom="1px"
            android:layout_gravity="left"/>
        <ImageButton 
            android:id="@+id/button_properties"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#77000000"
            android:src="@drawable/ic_slider_properties"
            android:padding="5px"
            android:layout_marginBottom="1px"
            android:layout_gravity="left"/>
        <ImageButton 
            android:id="@+id/button_special_effects"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#77000000"
            android:src="@drawable/ic_slider_special_effects"
            android:padding="5px"
            android:layout_marginBottom="1px"
            android:layout_gravity="left"/>
        <ImageButton 
            android:id="@+id/button_test1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#77000000"
            android:src="@drawable/ic_slider_exposure"
            android:padding="5px"
            android:layout_marginBottom="1px"
            android:layout_gravity="left"/>
        <ImageButton 
            android:id="@+id/button_test2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#77000000"
            android:src="@drawable/ic_slider_exposure"
            android:padding="5px"
            android:layout_marginBottom="1px"
            android:layout_gravity="left"/>

     </LinearLayout>
 </SlidingDrawer>
</RelativeLayout>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

月亮坠入山谷 2024-09-19 00:46:38

您的哪一部分遇到了问题?抽屉还是设置?有关设置请查看查看存根,如果这是您遇到困难的抽屉,请尝试 SlidingDrawer

What part are you having trouble with? The drawer or the settings? For the setting check out view stubs, if it's the drawer you're struggling with try SlidingDrawer.

筑梦 2024-09-19 00:46:38

神奇之处在于:将抽屉的背景设置为#00000000!

Here's the magic: set drawer's background to #00000000!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文