android中使用图文并茂的按钮
上代码:
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:gravity="center"
android:background="#8fff" >
<Button android:text="XX人员"
android:textSize="12sp"
android:textColor="#333"
android:gravity="center_vertical|center_horizontal"
android:id="@+id/unit_btn_cyry"
android:layout_width="100dp"
android:layout_height="40dp"
android:padding="10dp"
android:drawableLeft="@drawable/icon_cyry"
android:background="@drawable/shape_both_corner_white"></Button>
<Button android:text="XXX人员"
android:textSize="12sp"
android:textColor="#333"
android:gravity="center_vertical|center_horizontal"
android:id="@+id/unit_btn_xgry"
android:layout_width="100dp"
android:layout_height="40dp"
android:padding="10dp"
android:layout_marginLeft="20dp"
android:drawableLeft="@drawable/icon_xgry"
android:background="@drawable/shape_both_corner_white"></Button>
</LinearLayout>
android中使用图文并茂的按钮的更多相关文章
- Android笔记(十四) Android中的基本组件——按钮
Android中的按钮主要包括Button和ImageButton两种,Button继承自TextView,而ImageButton继承自ImageView.Button生成的按钮上显示文字,而Ima ...
- android 中怎么保存当前按钮的状态?就是退出后重新进入还是上一次离开的状态
比如当前Activity中有一个按钮目前是开启,点击后按钮的text变成关闭!然后退出该Activtity,然后重新打开该Activity后当前按钮的状态还是关闭呢? 就是设置一个状态flag.fla ...
- 在Android中调用C#写的WebService(附源代码)
由于项目中要使用Android调用C#写的WebService,于是便有了这篇文章.在学习的过程中,发现在C#中直接调用WebService方便得多,直接添加一个引用,便可以直接使用将WebServi ...
- Android中Touch事件分析--解决HorizontalScrollView滑动和按钮事件触发问题
之前写过关于HorizontalScrollView滑动和按钮事件触发问题,但是不能所有的情况,最近几天一直在想这个问题,今天有一个比较好的解决思路,最终应用在项目里面效果也很好,首先说明一下功能: ...
- android中ListView点击和里边按钮点击不能同时生效问题解决
今天遇到一个问题:android中ListView点击和里边button点击不能同时生效问题解决. 原因是: listView 在开始绘制的时候,系统首先调用getCount()函数,根据他的返回值得 ...
- 【转】【已解决】Android中ActionBar中不显示overflow(就是三个点的那个按钮)--不错
原文网址:http://www.crifan.com/android_actionbar_three_dot_overflow_not_show/ [问题] 折腾: [记录]继续尝试给Android程 ...
- Mono For Android中简单实现按钮的动画效果
Android中动画的分Tween Animation和Frame Animation,本节主要讲Tween Animation的实现. 一般是通过XML文件来定义动画的,具体如下: 1.在项目res ...
- android中在java代码中设置Button按钮的背景颜色
android中在java代码中设置Button按钮的背景颜色 1.设置背景图片,图片来源于drawable: flightInfoPanel.setBackgroundDrawable(getRes ...
- Android中BroadcastReceiver的两种注册方式(静态和动态)详解
今天我们一起来探讨下安卓中BroadcastReceiver组件以及详细分析下它的两种注册方式. BroadcastReceiver也就是"广播接收者"的意思,顾名思义,它就是用来 ...
随机推荐
- 设置清除html5页面缓存
设置清除html5页面缓存 html5端设置 meta 标签: <meta http-equiv="Pragma" content="no-cache" ...
- 网页中打开exe
网页上打开本地的exe文件,可以吗? 西蒙说:可以的. 方法如下: 1.定义一个私有协议,指向本地的那个exe 2.在网页上将此私有协议作为URL,点击之即可打开那个exe 3.URL中还可以包含参数 ...
- WinPE:创建 USB 可引导驱动器
https://msdn.microsoft.com/zh-cn/library/windows/hardware/dn938386(v=vs.85).aspx
- USACO35 翻转奶牛(尺取法)
通过这道题了解了不少有关翻转的知识呢...... 首先,我们枚举翻转的区间长度k,假设i有个按钮,按下就可以让i~i+k-1翻转,那就有两个状态,按i或不按i(因为按两次相当于没按),那就往后扫一遍, ...
- linux下nginx模块开发入门
本文模块编写参考http://blog.codinglabs.org/articles/intro-of-nginx-module-development.html 之前讲了nginx的安装,算是对n ...
- sphinx 针对tedfield搜索
query = "(user can be admin)" -> check all fields for the given words. If all words ar ...
- java计算时间差及比较时间大小(转)
比如:现在是2004-03-26 13:31:40 过去是:2004-01-02 11:30:24 我现在要获得两个日期差,差的形式为:XX天XX小时XX分XX秒 方法一: DateFo ...
- AutoIT: 学习对GUI Sample上所有的资源进行操作
$handle= WinGetHandle("Sample GUI") ;,"SRE Example 3 Result", $handle) $ctrl= Co ...
- 【WIP】Ruby JSON
创建: 2018/03/22 以后有空补上 注: JSON.generate 参数只能是Obejct或者Array, 不可以是Hash https://docs.ruby-lang.org/ja/la ...
- bzoj 1863: [Zjoi2006]trouble 皇帝的烦恼【二分+dp】
二分答案,注意l是max(a[i]+a[i+1]),r是sum_a 判断的时候用dp,设f[i]为i与1最少的相同颜色数,g[i]为i与1最多的相同颜色数,转移是f[i]=max(a[i]-(w-a[ ...