Android-图片按钮汇总
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.hanqi.testapp2.TestActivity1"
android:orientation="vertical"> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/anniu04"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/anniu05"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/anniu04"
android:text="普通按钮"/>
</LinearLayout> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/yuantu"
android:alpha="1"
android:background="#f00"
android:scaleType="center"/>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/yuantu"
android:alpha="1"
android:background="#f00"
android:scaleType="centerCrop"/>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/yuantu"
android:alpha="1"
android:background="#f00"
android:scaleType="centerInside"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/yuantu"
android:alpha="1"
android:background="#f00"
android:scaleType="matrix"/>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/yuantu"
android:alpha="1"
android:background="#f00"
android:scaleType="fitCenter"/> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/yuantu"
android:alpha="1"
android:background="#f00"
android:scaleType="fitStart"/>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/yuantu"
android:alpha="1"
android:background="#f00"
android:scaleType="fitEnd"/> <ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/yuantu"
android:alpha="1"
android:background="#f00"
android:scaleType="fitXY"/>
</LinearLayout>
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="男"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="女"/>
</RadioGroup>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.administrator.testapp2"> <application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".TestActivity1">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application> </manifest>
package com.example.administrator.testapp2; import android.support.v7.app.AppCompatActivity;
import android.os.Bundle; public class TestActivity1 extends AppCompatActivity { @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test1);
}
}
Android-图片按钮汇总的更多相关文章
- Android ImageButton Example 图片按钮
Android ImageButton Example 图片按钮 使用“android.widget.ImageButton” 展现一个具有背景图片的按钮 本教程将展现一个具有名字为 c.png背景图 ...
- android带有文字的图片按钮的两种实现方式
android带有文字的图片按钮的两种实现方式 1). TextView对Button用相对布局,这要要求按钮的背景图片要留下空白位置给文字.这种方式开发比较简单,适合做一些风格一致的Button. ...
- 【同行说技术】Android图片处理技术资料汇总(一)
对于Android开发的童鞋们来说,图片处理时或多或少都会遇到令人头疼和不满意的问题,今天小编收集了5篇Android图片处理的干货文章,一起来看看吧! 一.Android 高清加载巨图方案 拒绝压缩 ...
- 【同行说】Android图片处理技术资料汇总(一)
对于Android开发的童鞋们来说,图片处理时或多或少都会遇到令人头疼和不满意的问题,今天小编收集了5篇Android图片处理的干货文章,一起来看看吧! 一.Android 高清加载巨图方案 拒绝压缩 ...
- Android开源项目库汇总
最近做了一个Android开源项目库汇总,里面集合了OpenDigg 上的优质的Android开源项目库,方便移动开发人员便捷的找到自己需要的项目工具等,感兴趣的可以到GitHub上给个star. 抽 ...
- fir.im Weekly - 600个 Android 开源项目汇总
本期 Weekly 收集了一些热度资源,包含 Android.iOS 开发工具与源码分享,程序员也应该了解的产品运营.设计等 Tips ,希望对你有帮助. 600个Android开源项目汇总 勤劳的 ...
- fackbook的Fresco (FaceBook推出的Android图片加载库-Fresco)
[Android开发经验]FaceBook推出的Android图片加载库-Fresco 欢迎关注ndroid-tech-frontier开源项目,定期翻译国外Android优质的技术.开源库.软件 ...
- [转]【eoeAndroid索引】史上最牛最全android开发知识汇总
一.开发环境搭建 (已完成) 负责人:kris 状态:已完成 所整理标签为:搭建 SDK JDK NDK Eclipse ADT 模拟器 AVD 调试器(DEBUG) DDMS 测试 日志 Logca ...
- 图片按钮(imageButton)
图片按钮(imageButton) 常用属性: android:src="@drawable/download" (这里的download是一张图片的名称,通过引用该图片的名称直接 ...
- Android图片加载框架最全解析(八),带你全面了解Glide 4的用法
本篇将是我们这个Glide系列的最后一篇文章. 其实在写这个系列第一篇文章的时候,Glide就推出4.0.0的RC版了.那个时候因为我一直研究的都是Glide 3.7.0版本,再加上RC版本还不太稳定 ...
随机推荐
- oracle ebs 采购订单关闭之PL/SQL实现方法
应客户需求,需要写个脚本,批量关闭Bonus Item类型的采购订单,在metalink上搜索到一些方法,但是都测试不通.原来需要将代码生成一个并发程序.下面是测试成功的代码. 1.首先创建一个存储过 ...
- js获取单选框radio的值
遇到一个js获取radio值的问题,原来根据frm.type.value取到的值在ie下是空值 解决办法:type为每个radio的值 var chkObjs=document.getElements ...
- Swift数据类型简介
用 Swift 编写 iOS 和 OS X 应用将是一场美妙的体验,Swift 之后也会不断开发新特性和兼容性. Swift 提供了与C.Objective-C的相似的基础数据类型,包含整数Int,浮 ...
- CentOS修改主机名和网络信息
1.修改主机名称 [root@centos ~]# vim /etc/sysconfig/network打开文件,修改以下内容并保存 NETWORKING=yes #使用网络 HOSTNAME=cen ...
- jeditable参数详解
一.导入js文件 <script type="text/javascript" src="jquery-1.10.2.min.js"></sc ...
- Nginx+Keepalived实现 转载
一.Keepalived简介 keepalived是一个类似于layer3, 4 & 5交换机制的软件,也就是我们平时说的第3层.第4层和第5层交换.Keepalived的作用是检测web服务 ...
- sort DEMO
测试用文件: [weblogic@etp-mall-dev7][/tmp]$ cat msn.txt aaa, fff, bbb, cc, ee, gg, hh, zz, mmm, DEMO1:按第一 ...
- frameset子窗口获取父窗口失败原因?
报错信息: arrow.html:44 Uncaught SecurityError: Blocked a frame with origin "null" from access ...
- 为什么Redis内存不宜过大
redis这个内存数据库,它的高性能.稳定性都是不用怀疑的,但我们塞进redis的数据过多,内存过大,那如果出问题,那它可能会带给我们的就是灾难性. 作者:程超来源:网络|2016-05-23 09: ...
- 在MyEclipse中搭建Spring MVC开发环境
环境版本 IDE:MyEclipse 8.5 Spring:spring 3.2.8 JDK:1.6 1.打开MyEclipse-->File-->New-->Web Project ...