标签: direction

检测适配器中的滚动方向(向上/向下)

我想在我的项目中模仿Google Plus应用程序,因为它现在似乎是参考.

滚动时的列表视图效果非常好,我想做类似的事情.

我已经开始使用LayoutAnimationController http://android-er.blogspot.be/2009/10/listview-and-listactivity-layout.html

LayoutAnimationController controller 
   = AnimationUtils.loadLayoutAnimation(
     this, R.anim.list_layout_controller);
  getListView().setLayoutAnimation(controller);
Run Code Online (Sandbox Code Playgroud)

这似乎很糟糕,因为并非所有元素都是动画的:

所以我最后使用了适配器的getView并使用它:

        AnimationSet set = new AnimationSet(true);

        Animation animation = new AlphaAnimation(0.0f, 1.0f);
        animation.setDuration(800);
        set.addAnimation(animation);

        animation = new TranslateAnimation(
            Animation.RELATIVE_TO_SELF, 0.0f,Animation.RELATIVE_TO_SELF, 0.0f,
            Animation.RELATIVE_TO_SELF, 1.0f,Animation.RELATIVE_TO_SELF, 0.0f
        );
        animation.setDuration(600);
        set.addAnimation(animation);

        row.startAnimation(set);
Run Code Online (Sandbox Code Playgroud)

结果太棒了,我真的很开心!

不幸的是,它只有在我从列表的顶部滚动到底部时才有效!

我想在另一边滚动时使它工作,我需要改变一点TranslateAnimation.

所以我的问题是,有没有办法检测我是否在我的适配器中向上或向下滚动?

animation android listview scroll direction

16
推荐指数
5
解决办法
3万
查看次数

在ViewPager中滑动方向

我有一个使用ViewPager和FragmentStatePagerAdapter的Android应用程序.然而,我需要添加一个新功能,我必须知道滑动方向从一个片段视图移动到另一个,左或右.(也就是说,当我向左滑动时,我会做一件事,当我向右滑动时,我会做其他事情).

请注意,我不需要在滑动结束后发生事件.滑动发生时我必须做这些事件.我想过使用setOnPageChangeListener()但它并没有告诉我滑动方向.你能告诉我如何找出滑动方向吗?

谢谢.

android direction swipe android-viewpager fragmentstatepageradapter

15
推荐指数
3
解决办法
2万
查看次数

使用googleMaps api在swift mapView中显示方向按钮

我正在为android和ios开发一个应用程序.在android mapview中,当我点击地图的标记时,2个按钮显示在视图的底部.(路线和googlemaps)查看上传的图片

在此输入图像描述

按照谷歌的指示,我在swift中设置mapView以显示来自谷歌的地图.但是当我点击标记时,我在mapView中看不到任何按钮.这是为什么?

google有关在swift中设置mapview的说明:https: //developers.google.com/maps/documentation/ios-sdk/start

google-maps direction ios swift

14
推荐指数
1
解决办法
5690
查看次数

如何更改 tailwind css 中的渐变方向?

 <div class="bg-gradient-to-r from-cyan-500 to-blue-500 ">
Run Code Online (Sandbox Code Playgroud)

。。。。

我已经尝试过上面的代码。但这是线性渐变,我想要垂直渐变。

gradient direction tailwind-css

14
推荐指数
1
解决办法
3万
查看次数

iOS高级手势:获取滑动方向向量

通过文档查看,似乎新的高级手势API无法确定滑动方向超出基本{left,right,up,down}.

我需要滑动的起点和方向.

除了编写我自己的高级手势库从基本手势编码以外,还有其他方法来检索这个吗?

如果这是我唯一的选择,有人能指出一些开源代码吗?

vector direction gesture swipe ios

13
推荐指数
1
解决办法
1万
查看次数

MKMapView路线/方向

我发现Google Maps API支持路线:

var map;
var directionsPanel;
var directions;

function initialize() {
  map = new GMap2(document.getElementById("map_canvas"));
  directionsPanel = document.getElementById("my_textual_div");
  map.setCenter(new GLatLng(49.496675,-102.65625), 3);
  directions = new GDirections(map, directionsPanel);
  directions.load("from: 500 Memorial Drive, Cambridge, MA to: 4 Yawkey Way, Boston, MA 02215 (Fenway Park)");
}
Run Code Online (Sandbox Code Playgroud)

那么如何将其转换为Objective-C,以便iPhone可以检索它?我知道如何在MKMapView上画一条线我只需要路线的地理位置.

或者也许有一种不同的方式来获得两个地理位置点之间的路线.

请告诉我,

提前致谢.

iphone direction mkmapview map-directions

12
推荐指数
2
解决办法
2万
查看次数

XNA 2D矢量角度 - 计算的正确方法是什么?

2D中的XNA是什么,矢量角度的标准方式有效?

向右0度,向上90度,向左180度,向下270度?

什么是'标准'实施

float VectortoAngle(Vector2 vec)
Run Code Online (Sandbox Code Playgroud)

Vector2 AngleToVector(float angle)
Run Code Online (Sandbox Code Playgroud)

那么VectortoAngle(AngleToVector(PI))== PI?

xna 2d vector angle direction

12
推荐指数
1
解决办法
2万
查看次数

像在Compass中一样在iPhone中查找方向?

有没有人想用iPhone找到真正的方向?我想实现这样的应用程序,其中我需要找到iPhone指向的方向,并希望使应用程序与iphone 3GS中的指南针应用程序相同.

iPhone 3G是否支持罗盘功能?并且任何人都可以告诉我罗盘应用程序如何像真正的磁罗盘那样准确地找到方向吗?

请帮帮我.我处于危急的境地.

提前致谢.

iphone direction cllocationmanager map-directions compass-geolocation

11
推荐指数
1
解决办法
9371
查看次数

根据行驶方向旋转标记

我的Google地图中有一个标记,如下所示:

PIC

当用户开车时,我想根据他的行驶方向旋转它.我怎样才能做到这一点?我应该使用以前的位置和当前位置坐标进行计算,但我不知道如何.

android google-maps angle direction driving-directions

11
推荐指数
1
解决办法
2万
查看次数

在CSS中反转高度方向

我想将自上而下的高度增长路径更改为Down-top它是否可以在CSS中使用?这是我的代码
http://jsfiddle.net/yasharshahmiri/1pkemq1p/3/

        .buttom{
margin-top:200px;
margin-right:34px;
width:150px;
height:45px;
background:black;
float:right;
transition-duration:2s;  }
    .buttom:hover{
        height:180px;
        transition-duration:2s;}
Run Code Online (Sandbox Code Playgroud)

html css height direction

9
推荐指数
2
解决办法
2万
查看次数