小编Gra*_*tzi的帖子

ExpandableListView - 隐藏没有子项的组的指示符

在一个ExpandableListView,有没有办法隐藏没有孩子的群组指标?

android expandablelistview android-listview

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

在android上使用全局异常处理

是否有代码示例或有关如何使用该Thread.setDefaultUncaughtExceptionHandler方法的教程?基本上我在我的应用程序中尝试在抛出异常时显示自定义警报对话框.是否有可能做到这一点?我知道在屏幕上显示某些内容有点棘手,如果在UI线程中抛出异常,但我不知道任何解决方法.

android exception-handling

58
推荐指数
4
解决办法
5万
查看次数

禁用所有视图的触摸事件

禁用所有视图的触摸事件的最佳方法是什么?

非常感谢,

的Gratzi

android

43
推荐指数
8
解决办法
7万
查看次数

为视图使用淡入动画

我希望有一个View最初是不可见的,当我按下一个按钮时,它会以淡入淡出的动画显示出来.我正在使用AlphaAnimation褪色效果.问题是,如果我使视图不可见,则无法看到动画.

非常感谢,

的Gratzi

android android-animation

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

按下时更改图像视图的源图像

我有一个带有大量图像按钮的滚动视图.我想在按下时更改图像按钮的图像.问题是我希望图像保持不变,直到按下另一个图像按钮.这就是我无法使用选择器的原因.实现他的最佳实践是什么?

最好的祝福

android

23
推荐指数
6
解决办法
7万
查看次数

不同屏幕尺寸的不同字体大小

在我的应用程序中,我必须使用较小的字体用于中密度设备.有可能指定吗?

android

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

wrap_content用于listview的宽度

有没有办法让ListView的with等于最长的行?为ListView的宽度设置wrap_content无效.ListView水平覆盖整个屏幕.

这是活动布局

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ListView   android:id="@+id/listview"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/country_picker_bg" />
Run Code Online (Sandbox Code Playgroud)

这是行xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<LinearLayout 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    android:layout_marginBottom="@dimen/padding"
    android:padding="@dimen/padding"
    android:background="@drawable/white_round_rect" >
    <TextView android:id="@+id/title"
        style="@style/GreyTextView"
        android:layout_marginLeft="@dimen/padding"/>    
    <ImageView  
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        android:src="@drawable/orange_arrow_selector"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

谢谢Gratzi

android listview width

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

设置EditText的最大文本行数

有没有办法指定一个最大行数EditText?我指的是所有文本行,而不仅仅是可见文本(描述the android:maxLines属性).行号不能为1,因此android:singleLine不是一个选项.

android

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

RadioGroup带有不同布局的单选按钮

是否可以在自己的布局中设置一个带单选按钮的无线电组?每个单选按钮都必须位于包含文本和图像的行上.我不会使用列表视图,因为我只有2行.

非常感谢,

的Gratzi

android

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

围绕轴心点旋转图像

问题很简单:我想围绕某个枢轴点旋转图像.这是我使用的代码:

Matrix matrix = new Matrix();
matrix.setTranslate(bmpWidth/2, 0);
matrix.preRotate(degrees, bmpWidth/2, 0);

Bitmap resizedBitmap = Bitmap.createBitmap(
    bitmap, 0, 0, bmpWidth, bmpHeight, matrix, true);
ImageView imageView = (ImageView) findViewById(R.id.bell);
imageView.setImageBitmap(resizedBitmap);
Run Code Online (Sandbox Code Playgroud)

我从加速计传感器获得旋转度.结果是每次图像围绕其中心点旋转.

android

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