起初这一切似乎都很好,我的SlIDingDrawer的手柄在屏幕的底部.
但是,如果我开始拖动句柄,内容开始显示,它将被句柄的边框矩形剪辑.如果我拖动句柄,整个内容最终会被显示出来,但是如果我现在向下拖动句柄,它将被内容的边框矩形剪辑.此外,如果手柄一直在上升,一旦我开始拖动它,整个内容消失.
我仍然可以点击屏幕上的句柄,拖动它并显示内容,但是我需要猜测句柄在哪里.
似乎导致这一点的事实是,我在SlIDingDrawer之前的xml文件中有一个SurfaceVIEw.
从xml中删除视图可以解决这个问题,但是我需要这个视图.
这是xml:
<FrameLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent"> <!-- Removing this DrawVIEw from here solves the problem --> <com.package.DrawVIEw androID:ID="@+ID/main" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent" /> <SlIDingDrawer androID:ID="@+ID/SlIDingDrawer" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:allowSingleTap="true" androID:animateOnClick="true" androID:handle="@+ID/slIDeHandlebutton" androID:content="@+ID/contentLayout" androID:padding="10dip"> <button androID:ID="@+ID/slIDeHandlebutton" androID:layout_wIDth="fill_parent" androID:layout_height="wrap_content" androID:background="@drawable/slIDing_button"> </button> <linearLayout androID:ID="@+ID/contentLayout" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:orIEntation="vertical"> <button androID:ID="@+ID/clearbutton" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:text="Test"> </button> </linearLayout> </SlIDingDrawer></FrameLayout>
Java的:
package com.package;import androID.app.Activity;import androID.os.Bundle;public class SlIDeTest extends Activity { /** Called when the activity is first created. */ @OverrIDe public voID onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentVIEw(R.layout.main); }}package com.package;import androID.content.Context;import androID.util.AttributeSet;import androID.vIEw.SurfaceVIEw;public class DrawVIEw extends SurfaceVIEw{ public DrawVIEw(Context context,AttributeSet attrs) { super(context,attrs); }}
编辑:我只是注意到,如果DrawVIEw扩展VIEw而不是SurfaceVIEw,这个问题消失了.
但是,在使用专用绘图线程时,我正在使用专用的绘图线程,并根据文档(和LunarLander示例),它应该绘制到SurfaceVIEw.
任何帮助将不胜感激!
解决方法 机器人:背景= “#00000000”背景颜色是问题.
总结以上是内存溢出为你收集整理的Android:SlidingDrawer在SurfaceView下消失全部内容,希望文章能够帮你解决Android:SlidingDrawer在SurfaceView下消失所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)