布局之按钮的图片分辨率--Android Studio

在布局页面,想把取消按钮和确认钮大小一致,刚开始想法是错的,不用在控制层设置,也不用在布局层压缩图片,有两个方法法:
1.直接用美图秀秀“尺寸”功能,修改成另一按钮一样的分辨率。
2.设置按钮相同高度,android:layout_height="50dp"。
用第二种比较好,不改变图片,方便其它布局引用,附本页面布局代码:
<FrameLayout
android:id="@+id/FrameLayout1"
android:layout_width="match_parent"
android:layout_height="40dp" >
<ImageView
android:id="@+id/back"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
android:src="@drawable/back" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_horizontal"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="扫码登录"
android:textSize="22sp" />
</LinearLayout>
</FrameLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#cccccc" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
> <ImageView
android:id="@+id/image_view"
android:layout_width="match_parent"
android:layout_height="280dp"
android:src="@drawable/pc" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_guiji"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="vertical" >
<Button
android:id="@+id/btn_queding"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="10dp"
android:layout_marginTop="50dp"
android:background="@drawable/xiayibu"
android:text="确认登录电脑端"
android:textColor="#FFF" />
<Button
android:id="@+id/btn_quxiao"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_gravity="bottom"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:text="取消登录"
android:background="@drawable/aa"
/>
</LinearLayout>

布局之按钮的图片分辨率--Android Studio的更多相关文章
- Android ImageView 不显示JPEG图片 及 Android Studio中怎样引用图片资源
Android ImageView 不显示JPEG图片 今天在写一个小实例,ImageView在xml里面设置的是INVISIBLE,在代码里须要设置成setVisibility(View.VISIB ...
- 【转】你所不知道的Android Studio调试技巧
这篇写Android studio debug技巧个人觉得写得不错,转自:http://www.jianshu.com/p/011eb88f4e0d# Android Studio目前已经成为开发An ...
- 你所不知道的Android Studio调试技巧
转载:http://www.jianshu.com/p/011eb88f4e0d Android Studio目前已经成为开发Android的主要工具,用熟了可谓相当顺手.作为开发者,调试并发现bug ...
- 【Android Studio安装部署系列】二十六、Android studio录制屏幕并生成gif文件
版权声明:本文为HaiyuKing原创文章,转载请注明出处! 概述 Android Studio自带录制屏幕功能,那么就可以很方便地将手机上的屏幕操作录制成视频.然后借助一些软件或者网站转换成gif文 ...
- 第一篇:安装Android Studio问题及其解决方案
ubuntu18.04配置android studio3.2.1环境 1.JDK安装与配置:https://www.cnblogs.com/yuanbo123/p/5819564.html(按照文档操 ...
- Android Studio代码调试大全
http://blog.csdn.net/dd864140130/article/details/51560664 Android Studio目前已经成为开发android的主要工具,用熟了可谓相当 ...
- Android Studio 之生成正式签名的 APK 文件
生成 APK 文件 •步骤 点击 Build -> Generate Signed...... : 来到如下界面: 选择 APK 选项,点击 Next 来到如下界面: 如果你电脑上没有一个正式 ...
- 设置Android Studio启动时可选最近打开过的工程
Android Studio启动时,默认会打开最近关闭的工程. 如果想Android Studio在启动时,打开欢迎界面(Welcome to Android Studio界面),则可以通过设置Set ...
- Android Studio 集成 TFS,实现安卓移动开发的持续集成和交付(DevOps)
目录 1 集成TFS系统.... 1.1 概述.... 1.2 安装TFS插件.... 1.2.1 在线安装方式.... 1.2.2 离线安装方案.... 1.3 常见操作.... 1.3.1 新建G ...
随机推荐
- Linux吃掉我的内存
在Windows下资源管理器查看内存使用的情况,如果使用率达到80%以上,再运行大程序就能感觉到系统不流畅了,因为在内存紧缺的情况下使用交换分区,频繁地从磁盘上换入换出页会极大地影响系统的性能.而当我 ...
- [转]中国最大的Webshell后门箱子调查,所有公开大马全军覆没
起因 对这件事情的起因是某天我渗透了一个大站,第二天进webshell时就发现,当前目录出现了新的后门,仔细一查,发现是博彩团伙干的,网站被全局劫持黑帽程序如下代码 set_time_limit(); ...
- jboss配置数据源
配置的是mysql的数据源 找到jboss-.GA\docs\examples\jca\mysql-ds.xml 复制一份到jboss-.GA\server\default\deploy目录下 然后修 ...
- python_爬虫一之爬取糗事百科上的段子
目标 抓取糗事百科上的段子 实现每按一次回车显示一个段子 输入想要看的页数,按 'Q' 或者 'q' 退出 实现思路 目标网址:糗事百科 使用requests抓取页面 requests官方教程 使用 ...
- C#使用正则表达式检测数字 char 和韩文
if (!System.Text.RegularExpressions.Regex.IsMatch(strRoleName[i].ToString(), @"^[\uac00-\ud7ff] ...
- poj[1187][Noi 01]陨石的秘密
Description 公元11380年,一颗巨大的陨石坠落在南极.于是,灾难降临了,地球上出现了一系列反常的现象.当人们焦急万分的时候,一支中国科学家组成的南极考察队赶到了出事地点.经过一番侦察,科 ...
- Spring源码分析——资源访问利器Resource之实现类分析
今天来分析Spring的资源接口Resource的各个实现类.关于它的接口和抽象类,参见上一篇博文——Spring源码分析——资源访问利器Resource之接口和抽象类分析 一.文件系统资源 File ...
- 在intellj idea下用sbt的坑
version : SBT 0.13.7 intellij 14 新建SBT项目以后无法编译,总是显示 Can not resolve symble stackoverflow 给出了暂时的解决办法. ...
- [HTTP Protocol] 200 OK (from cache)和304 Not Modified
含义 200 OK (from cache)直接从缓存中获取的内容并未请求服务器 304 Not Modified 请求服务器并和服务器比较 If-Modified-Since,若文件未改变,服务器返 ...
- cocopod 中添加第三方框架,包含静态库文件,使用svn添加上传
step one: 进入静态库文件的目录 cd 路径: step two:使用命令添加 svn add 静态库名字; 然后更新一下代码就OK