小编sch*_*sch的帖子

使用GroupBy进行Realm.io查询

我想按月分组一些帐户,我能用Realm.io做这个吗?

public class Account extends RealmObject {
.....
 private Date date;
}

RealmResults accounts = realm.where(Account.class)
.beginGroup()
.equalTo("date", "MONTH(date)")//<----- wrong code
.endGroup()
.findAll();
Run Code Online (Sandbox Code Playgroud)

谢谢

java sql orm android realm

6
推荐指数
1
解决办法
3721
查看次数

AngularJS + Facebook就像指令不起作用

我正在开发一个AngularJs应用程序,它在视图中集成了fb-like.它只适用于第一次,如果我也刷新浏览器,当我导航到其他视图并回来时插件不起作用.

我已经创建了一个指令.

angular.module('myApp.directives', []).directive('fbLike',['$timeout', function($timeout) {
return {
    restrict: 'A',
    scope: {},
    template: "<div class=\"fb-like-box\" data-href=\"{{page}}\" data-width=\"{{width}}\" data-show-faces=\"{{faces}}\" data-height=\"{{height}}\" data-show-border=\"{{border}}\" data-stream=\"{{stream}}\" data-header=\"{{header}}\"></div>",
    link: function($scope, $element, $attrs) {
        var working, _ref, _ref1;

        $scope.page ="https://www.facebook.com/company_name";
        $scope.border = false;
        $scope.height = (_ref = $attrs.fbHeight) != null ? _ref : '260';
        $scope.faces = $attrs.fbFaces != null ? $attrs.fbFaces : 'false';
        $scope.stream = $attrs.fbStream != null ? $attrs.fbStream : 'true';
        $scope.header = $attrs.fbHeader != null ? $attrs.fbHeader : 'false';
        $scope.width = (_ref1 = $attrs.fbWidth) != …
Run Code Online (Sandbox Code Playgroud)

html javascript facebook angularjs

5
推荐指数
1
解决办法
4467
查看次数

Angularjs - ng-switch是否有内容加载事件?

我有一个具有不同内容的ng-switch,其中一个是Gallery,我必须在切换ng-switch-when = gallery内容准备好之后将JQuery事件设置为所有图像,但不幸运,因为它正在触发事件之前内容已加载.

画廊是第三个ng-switch-when所以我不能用ng-init设置事件.

那么,ng-switch是否有内容加载的事件或指令?

<a href="" ng-click="menuSelection='gallery';loadLibraryGallery();">GALER&Iacute;A</a>
Run Code Online (Sandbox Code Playgroud)

调节器

$scope.loadLibraryGallery = function(){
//I have to set this event to childrens after ng-switch-when=gallery is loaded
        $('.popup-gallery').magnificPopup();

    };
Run Code Online (Sandbox Code Playgroud)

任何的想法.求求你了,谢谢你.

javascript jquery web angularjs

4
推荐指数
1
解决办法
4295
查看次数

Android notifyDataSetChanged()只是最后添加的项目

我有一个ListView和它的适配器类扩展BaseAdapter.

我想为列表视图中的一个自定义部分设置动画.

我有部分动画,从右到左滑动 - 这是第一次非常好.

在适配器的方法中,与所示类似,为简洁起见:

public View getView(){

    Animation an = AnimationUtils.loadAnimation(mContext, R.anim.transladar);
    an.reset();
    vi.startAnimation(an);
    return vi;
}
Run Code Online (Sandbox Code Playgroud)

看起来不错,但是当我添加一个项目 chatAdapter.notifyDataSetChanged();被触发时刷新我的所有项目并重新启动动画.

我只想动画适配器本身的最后一项.

我希望你能帮助我.

android android-animation android-listview notifydatasetchanged

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