Z-指数在android系统? [英] Z-index in android?

查看:174
本文介绍了Z-指数在android系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经不止在一个XML 1的Elemen ..列表视图,slidingdrawer,和的EditText ...按钮
我想滑动抽屉顺序总是在其他元素的前面......但我不能。

I've more than one elemen in one xml.. listview,slidingdrawer,edittext and button... i want to sliding drawer order is always in front of another elements...but i can't..

在这里我的XML

<com.ltvie.chat.MultiDirectionSlidingDrawer
    xmlns:my="http://schemas.android.com/apk/res/com.ltvie.chat"
    android:id="@+id/drawer"
    my:direction="topToBottom"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    my:handle="@+id/handle"
    my:content="@+id/content"
    >
   <include
        android:id="@id/content"
        layout="@layout/pen_content"
        android:gravity="top"           
        />
     <ImageView
        android:id="@id/handle"
        android:layout_width="wrap_content"
        android:layout_height="5dp"
        android:src="@drawable/sliding_drawer_handle_bottom" />          
</com.ltvie.chat.MultiDirectionSlidingDrawer>

<ListView android:id="@+id/listView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:stackFromBottom="true"
    android:transcriptMode="alwaysScroll"
    android:layout_above="@+id/InnerRelativeLayout"
    android:layout_alignParentTop="true" 
/>  
 <RelativeLayout 
    android:id="@+id/InnerRelativeLayout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true" >
    <Button 
        android:text="kirim" 
        android:id="@+id/button_send"
        android:layout_alignParentRight="true" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:onClick="tambahItems"          
        >

    </Button>           
</RelativeLayout>

我的code在我的PICT结果波纹管:D

the result of mycode in my pict bellow :D

我想知道如何解决它?

对此,

推荐答案

您的XML不包含您的外部布局,但我认为它是一个相对的布局。在 RelativeLayout的,元素'Z级别由它们添加到容器中的顺序确定。视图中添加以后会在上面。试试你的滑动抽屉移动到你的外容器的底部。这样的 -

Your xml does not contain your outer layout, but I assume it is a relative layout. In a RelativeLayout, the elements' z levels are determine by the order they are added to the container. View added later will be on top. Try moving your sliding drawer to the bottom of your outer container. Like this --

<ListView android:id="@+id/listView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:stackFromBottom="true"
    android:transcriptMode="alwaysScroll"
    android:layout_above="@+id/InnerRelativeLayout"
    android:layout_alignParentTop="true" 
/>  
 <RelativeLayout 
    android:id="@+id/InnerRelativeLayout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true" >
    <Button 
        android:text="kirim" 
        android:id="@+id/button_send"
        android:layout_alignParentRight="true" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:onClick="tambahItems"          
        >

    </Button>           
</RelativeLayout> 

<com.ltvie.chat.MultiDirectionSlidingDrawer
    xmlns:my="http://schemas.android.com/apk/res/com.ltvie.chat"
    android:id="@+id/drawer"
    my:direction="topToBottom"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    my:handle="@+id/handle"
    my:content="@+id/content"
    >
   <include
        android:id="@id/content"
        layout="@layout/pen_content"
        android:gravity="top"           
        />
     <ImageView
        android:id="@id/handle"
        android:layout_width="wrap_content"
        android:layout_height="5dp"
        android:src="@drawable/sliding_drawer_handle_bottom" />          
</com.ltvie.chat.MultiDirectionSlidingDrawer>

这篇关于Z-指数在android系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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