小编Sha*_*sal的帖子

Gradle控制台 - 获取更多日志输出

我正在使用Android工作室.在gradle控制台中获取以下错误消息

编译错误.有关详细信息,请参阅日志

  • 尝试:使用--stacktrace选项运行以获取堆栈跟踪.使用--info或--debug选项运行以获取更多日志输出.

建筑失败

但是在哪里运行--info选项可以查看更多日志?

android-studio android-gradle-plugin

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

Android Twitter - 下拉刷新和隐藏标签

如何将list-view的滚动与其他视图同步,我也希望像twitter应用程序一样实现pull-down-refresh.在Twitter应用程序中,在向上滚动列表视图时,标签栏和底部视图会隐藏,如果向下滚动,下拉刷新视图就会出现.

下面的图像表示:没有滚动列表 没有滚动列表

下面的图像表示:向上滚动列表:标签栏和底部视图获取隐藏 向上滚动列表!

下面的图像表示:向下滚动列表:下拉刷新来了 向下滚动列表!

android android-custom-view android-animation android-listview android-scrollview

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

android:只为一个孩子应用clipChildren

<RelativeLayout
                android:id="@+id/RelativeLayout_grand_parent"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent" >
                <ListView
                    android:id="@+id/ListView_grand_parent"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent" />
            </RelativeLayout>
////////////////////////////

ListView holds the below row layout. 

/////// row_layout.xml ///////
<RelativeLayout
                android:id="@+id/RelativeLayout_parent"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" >
                <ImageView
                    android:id="@+id/ImageView_child"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/heart_icon" />
            </RelativeLayout>
////////////////////////////

I need to animate the child "ImageView_child" and move it outside the parent,
than I used below method :

disableClipOnParents(ImageView_child);
public void disableClipOnParents(View v) {
    if (v.getParent() == null) {
        return;
    }

    if (v instanceof ViewGroup) {
        ((ViewGroup) v).setClipChildren(false);
    }

    if (v.getParent() instanceof View) {
        disableClipOnParents((View) …
Run Code Online (Sandbox Code Playgroud)

android android-animation android-layout android-view

5
推荐指数
0
解决办法
505
查看次数

有时Picasso不会从内存缓存中加载图像

 private class CustomAdapter extends CursorAdapter {

@Override
public void bindView(View view, Context context, Cursor cursor) {
    if (view != null) {

        String url = cursor.getString(CONTENT_URL_COLUMN);
        ViewHolder viewHolder = (ViewHolder) view.getTag();
        final ImageView imageView = viewHolder.mImageViewIcon;
        final TextView textView = viewHolder.mTextViewName;

            Picasso.with(context).load(url).into(new Target() {

                @Override
                public void onBitmapLoaded(Bitmap arg0, LoadedFrom arg1) {
                    imageView.setImageBitmap(arg0);
                    imageView.setVisibility(View.VISIBLE);
                    textView.setVisibility(View.GONE);
                }

                @Override
                public void onBitmapFailed(Drawable arg0) {
                    imageView.setVisibility(View.GONE);
                    textView.setVisibility(View.VISIBLE);
                }
             });
        }
    }
}
}
Run Code Online (Sandbox Code Playgroud)

如果已经下载了图像列表,则在快速滚动列表时, 调用onBitmapLoaded()方法并从内存缓存加载图像.但有时onBitmapFailed()调用.为什么?

android picasso

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

0
推荐指数
1
解决办法
88
查看次数