/**
*
* @desc 设置左边图标
* @param @param drw
* @return void
*/
public void setAlertLeftIcon(Drawable drw){
drw.setBounds(0, 0, drw.getMinimumWidth(), drw.getMinimumHeight());
alertTitle.setCompoundDrawables(drw, null, null, null);
}

android 通过代码设置drawableLeft的更多相关文章

  1. android 后台代码设置动画

    1.设置旋转动画 final RotateAnimation animation =new RotateAnimation(0f,360f,Animation.RELATIVE_TO_SELF, 0. ...

  2. Android中代码设置RadioButton的高端技巧

    不知道怎么起标题,就这样了. 目前主要讲两个方面内容: 代码方式 设置RadioButton的 android:button . android:background 等属性为 @null : 代码方 ...

  3. Android -- java代码设置margin

    我们平常可以直接在xml里设置margin,如: <ImageView android:layout_margin="5dip" android:src="@dra ...

  4. Android 通过代码设置radiobutton不同方位图标的两种方法

    更换radiobutton中的图片在xml中很好设置,但对于初学者如何在代码中设置还是不容易找的.没法子,通过看原版api找到两个方法,setCompoundDrawables和setCompound ...

  5. Android 用代码设置Shape,corners,Gradient

    网上查找资料 记录学习 int strokeWidth = 5; // 3dp 边框宽度 int roundRadius = 15; // 8dp 圆角半径 int strokeColor = Col ...

  6. Android小代码——设置全屏

    1: public class MainActivity extends Activity { 2: @Override 3: public void onCreate(Bundle savedIns ...

  7. Android在代码中设置控件的drawableLeft,drawableRight,drawableTop,drawableBottom。

    根据业务的需要,要在代码中设置控件的drawableLeft,drawableRight,drawableTop,drawableBottom属性. 我们知道在xml中设置的方法为:android:d ...

  8. 使用代码为textview设置drawableLeft

    xml中的textView中设置android:drawableLeft: <TextView android:id="@+id/bookTitle" android:lay ...

  9. Android Studio如何设置代码自动提示

    在用Eclipse时候,你可以进行设置,设置成不管你输入任何字母,都能进行代码的提示,在Android Studio中也可以 设置,而且比Eclipse设置来的简单.当然如果你觉得代码自动提示会降低你 ...

随机推荐

  1. 1036 : Trie图 (AC自动机)

    题目大意: 输入 n 个目标单词和一个文本串,判断文本串中是否存在某些目标单词. 思路 赤裸裸的 AC自动机. 代码: #include<iostream> #include<cst ...

  2. 关于storm群集容错概念的简单介绍

    1.当一个worker死掉会发生什么?        当一个worker死掉,那么supervisor会重新启动这个worker.如果它总是启动失败将不能发送心跳到nimbus,那么nimbus将把这 ...

  3. angular Error: [ng:areq]

    在使用augularjs的时候,爆了个错误: 后来经过对比,原来是我的<html>标签多了点东西

  4. TCP服务器:多进程

    代码: server: #include<netinet/in.h> #include<sys/socket.h> #include<sys/wait.h> #in ...

  5. 单向链表JAVA代码

        //单向链表类 publicclassLinkList{       //结点类     publicclassNode{         publicObject data;         ...

  6. 多线程、Service与IntentService的比较

    资料摘自网络(侵删)     Service Thread IntentService AsyncTask When to use ? Task with no UI, but shouldn't b ...

  7. NYOJ-104最大和

    我看了好多博客,都是拿一维的做基础,一维的比较简单,所以要把二维的化成一维的,一维的题目大意:给了一个序列,求那个子序列的和最大,这时候就可以用dp来做,首先dp[i]表示第i个数能构成的最大子序列和 ...

  8. rmi rpc restful soa 区别

    rmi rpc restful soa 区别 rmi vs rpc 参考文档:http://stackoverflow.com/questions/2728495/what-is-the-differ ...

  9. AJAX校验用户名是否存在,焦点离开用户名、点击 【 检 查用户名 】的校验。分别用 XMLHttp 和 JQueryAJAX实现。

     XMLHttp方法: $("#name").blur(function () { var xmlhttp = new ActiveXObject("Microsoft. ...

  10. 关于华为交换机bpdu enable. ntdp enable. ndp enable解析

    华为5300初始状态下每个口子都有,bpdu enable. ntdp enable. ndp enable.不是很明白什么意思,有什么样的用途. BPDU是网桥协议数据单元(Bridge Proto ...