即时通讯目前尝试添加SlidingDrawer
在我的应用程序.我的活动包括GridView
与SlidingDrawer
从底部来顶.现在我的问题是,我需要做的SlidingDrawer
是透明的,也将我GridView
顶在一定程度上..这是可能的制作..我是Android的新手..帮我解决这个问题...
如果移动GridView
它不是一个好主意,那么我希望它SlidingDrawer
来到它之上GridView
并使它成为一个透明的所以我GridView
可见
谢谢...
我试图确定Android中SlidingDrawer的"开放"百分比.看来抽屉只有onOpen,onClose和onScroll Listeners.OnScroll仅提供用于确定滚动何时结束以及滚动何时开始的方法.
TouchEvents也无法正常工作,因为SlidingDrawer可以滑动而不会被触摸......
我尝试使用getAnimation()抓取SlidingDrawer的动画(然后以某种方式确定基于此的百分比),但是返回null,getLayoutAnimation()也是如此.
有什么想法吗?
(请注意,此问题中描述的行为只是因为我们正在做的其他看似无关的事情而出现.请参阅接受的答案.)
我们有一个带有a GridView
和a的SlidingDrawer
内部的Android活动RelativeLayout
.此活动响应轨迹球(或光标键)的方式相当奇怪.焦点将在GridView中的项目之间移动,但每当光标在GridView的"out"方向移动时.(例如,当在顶部时向上,当已经在最左边的项目时离开)滑动抽屉打开或关闭.值得注意的是,焦点停留在GridView中的相同项目上 - 它不会移动到滑动抽屉.
使用轨迹球这是特别可怕的,因为将轨迹球旋转到您的真实目的地将导致滑动抽屉反复打开和关闭.
我们已经确定我们可以完全通过覆盖来关闭轨迹球onTrackballEvent()
.我们希望轨迹球和光标在GridView上正常工作,但不会导致滑动抽屉打开或关闭.原则上我们也喜欢轨迹球在打开时专注于滑动抽屉的各种内容.
怎么样?
在浪费了大量时间搜索之后,我终于发布了这个问题,希望得到答案.
我想在iOS中拥有一个小部件,它具有与Android中的Sliding Drawer类似的功能.(就像底部的栏,拉动它,它会显示一个新的视图).
任何帮助将不胜感激.
谢谢
我正在开发一个项目,我不应该使用任何XML文件,并且必须使用滑动Drawer.但我发现滑动抽屉不可能通过java编码,因此我开始制作动画,其中布局应该像滑动抽屉一样向上和向下移动并且什么也没有结束.
有人可以帮我解决这个问题
嗨,我一直在疯狂.
有几个问题,但没有一个似乎解决我的问题.我尝试设置抽屉布局时遇到错误.
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- As the main content view, the view below consumes the entire
space available using match_parent in both dimensions. -->
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:gravity="start"
>
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="test"
android:background="@drawable/black"
android:textColor="#94A1A1"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:layout_weight="1"
/>
<ListView
android:id="@+id/left_drawer_child"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#323232"
android:layout_weight="1"
/>
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)
和Java
/*
* Copyright 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the …
Run Code Online (Sandbox Code Playgroud) 我有一个framelayout的布局,其中有2个子视图,Sliding抽屉和listview.在滑动抽屉里面我需要一个滚动视图但是当我运行它时滚动视图无法滚动.以前有人有同样的问题吗?
这是我的布局,当我删除scrollview中的linearlayout时,它可以正常运行.有人可以帮忙吗?
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/myListView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</ListView>
<SlidingDrawer
android:id="@+id/slidedrawer"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:allowSingleTap="false"
android:content="@+id/konten"
android:handle="@+id/slider_handle" >
<LinearLayout
android:id="@+id/slider_handle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/slider_song"
android:paddingLeft="40dip"
android:paddingTop="10dip"
android:scaleType="centerCrop" >
<TextView
android:id="@+id/song_title_animation"
style="@style/CodeFont"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="No song played" />
</LinearLayout>
<!-- <include -->
<!-- android:id="@+id/konten" -->
<!-- layout="@layout/playback" /> -->
<LinearLayout
android:id="@+id/konten"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/album_art"
android:layout_width="match_parent"
android:layout_height="250dip"
android:background="@drawable/albumart"
android:gravity="bottom"
android:orientation="vertical" >
<SeekBar
android:id="@+id/seekbar_lagu"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="20"
android:progress="0" …
Run Code Online (Sandbox Code Playgroud) 我有一个SlidingDrawer和一个渲染图像的自定义SurfaceView.我刚刚尝试拖动SlidingDrawer,并且这样做发现它在SurfaceView中的图像后面并且完全隐藏.
您可以想象这对用户来说没什么用处,因此在拉起时需要图像始终落在SlidingDrawer之后.这可能吗?
包含它有助于这是xml中的SlidingDrawer:
<SlidingDrawer
android:id="@+id/drawer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:handle="@+id/handle"
android:content="@+id/content"
android:layout_alignParentBottom="true">
<TextView
android:id="@id/handle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingTop="5dip"
android:paddingBottom="5dip"
android:textStyle="bold"
android:text="text"/>
<include layout="@layout/content"
android:id="@id/content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</SlidingDrawer>
Run Code Online (Sandbox Code Playgroud)
这是xml中的SurfaceView:
<FrameLayout android:id="@+id/FrameLayout01"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<com.android.imagemagic.widgets.ImageManipulationSurfaceView
android:id="@+id/surfaceArea"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_gravity="center"/>
</FrameLayout>
Run Code Online (Sandbox Code Playgroud)
SurfaceView是自定义的,并在onDraw()方法中使用以下代码:
@Override
public void onDraw(Canvas canvas) {
super.onDraw(canvas);
//Clear canvas
Paint paint = new Paint();
paint.setXfermode(new PorterDuffXfermode(Mode.CLEAR));
canvas.drawPaint(paint);
paint.setXfermode(new PorterDuffXfermode(Mode.SRC));
// Draw image
canvas.drawBitmap(image, imageX, imageY, null);
}
Run Code Online (Sandbox Code Playgroud) 我在一个xml中有多个元素.. listview,slidedrawer,edittext和按钮......我想滑动抽屉顺序总是在另一个元素的前面...但我不能..
这是我的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>
Run Code Online (Sandbox Code Playgroud)
我的图片中的mycode结果如下:D
我想知道如何解决它?
看待,
我在 Flutter 项目中有一个简单的抽屉,我想让抽屉在用户滑动/打开时始终位于底部导航栏上方。我摆弄我的代码,但还找不到任何解决方案。
import 'package:flutter/material.dart';
import 'package:testing2/pages/ChannelsPage.dart';
import 'package:testing2/pages/HomePage.dart';
import 'package:testing2/pages/ExplorePage.dart';
import 'package:testing2/fragments/first_fragment.dart';
import 'package:testing2/fragments/second_fragment.dart';
import 'package:testing2/fragments/third_fragment.dart';
import 'package:testing2/Shared/drawer.dart';
class MyHomePage extends StatefulWidget {
@override
_MyBottomNavigationBarState createState() => _MyBottomNavigationBarState();
}
class _MyBottomNavigationBarState extends State<MyHomePage> {
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
int _currentSelected = 0;
GlobalKey<ScaffoldState> _drawerKey = GlobalKey<ScaffoldState>();
final List<Widget> _children = [
HomePage(),
SettingsPage(),
ContactPage(),
HomePage()
];
void onTappedBar(int index){
index == 3
? _drawerKey.currentState.openDrawer()
: setState((){
_currentSelected = index;
});
}
@override
Widget build(BuildContext context) {
return …
Run Code Online (Sandbox Code Playgroud)slidingdrawer navigation-drawer flutter flutter-layout flutter-animation