在布局页面,想把取消按钮和确认钮大小一致,刚开始想法是错的,不用在控制层设置,也不用在布局层压缩图片,有两个方法法:

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的更多相关文章

  1. Android ImageView 不显示JPEG图片 及 Android Studio中怎样引用图片资源

    Android ImageView 不显示JPEG图片 今天在写一个小实例,ImageView在xml里面设置的是INVISIBLE,在代码里须要设置成setVisibility(View.VISIB ...

  2. 【转】你所不知道的Android Studio调试技巧

    这篇写Android studio debug技巧个人觉得写得不错,转自:http://www.jianshu.com/p/011eb88f4e0d# Android Studio目前已经成为开发An ...

  3. 你所不知道的Android Studio调试技巧

    转载:http://www.jianshu.com/p/011eb88f4e0d Android Studio目前已经成为开发Android的主要工具,用熟了可谓相当顺手.作为开发者,调试并发现bug ...

  4. 【Android Studio安装部署系列】二十六、Android studio录制屏幕并生成gif文件

    版权声明:本文为HaiyuKing原创文章,转载请注明出处! 概述 Android Studio自带录制屏幕功能,那么就可以很方便地将手机上的屏幕操作录制成视频.然后借助一些软件或者网站转换成gif文 ...

  5. 第一篇:安装Android Studio问题及其解决方案

    ubuntu18.04配置android studio3.2.1环境 1.JDK安装与配置:https://www.cnblogs.com/yuanbo123/p/5819564.html(按照文档操 ...

  6. Android Studio代码调试大全

    http://blog.csdn.net/dd864140130/article/details/51560664 Android Studio目前已经成为开发android的主要工具,用熟了可谓相当 ...

  7. Android Studio 之生成正式签名的 APK 文件

    生成 APK 文件 •步骤 点击  Build -> Generate Signed...... : 来到如下界面: 选择 APK 选项,点击 Next 来到如下界面: 如果你电脑上没有一个正式 ...

  8. 设置Android Studio启动时可选最近打开过的工程

    Android Studio启动时,默认会打开最近关闭的工程. 如果想Android Studio在启动时,打开欢迎界面(Welcome to Android Studio界面),则可以通过设置Set ...

  9. Android Studio 集成 TFS,实现安卓移动开发的持续集成和交付(DevOps)

    目录 1 集成TFS系统.... 1.1 概述.... 1.2 安装TFS插件.... 1.2.1 在线安装方式.... 1.2.2 离线安装方案.... 1.3 常见操作.... 1.3.1 新建G ...

随机推荐

  1. EF6 DataMigration 从入门到进阶

    引言 在EntityFramework的开发过程中我们有时因需求变化或者数据结构设计的变化经常会改动表结构.但数据库Schema发生变化时EF会要求我们做DataMigration 和UpdateDa ...

  2. 三维网格补洞算法(Poisson Method)

    下面介绍一种基于Poisson方程的三角网格补洞方法.该算法首先需要根据孔洞边界生成一个初始化补洞网格,然后通过法向估算和Poisson方程来修正补洞网格中三角面片的几何形状,使其能够适应并与周围的原 ...

  3. 第一个JAVA应用

    1.1创建源文件 1.1.1Java源文件结构 Java应用由一个或多个扩展名为“.Java”的文件构成,这些文件被成为源文件.从编译角度,则被称为编译单元(Compilation Unit). 如果 ...

  4. Spring中的cglib动态代理

    Spring中的cglib动态代理 cglib:Code Generation library, 基于ASM(java字节码操作码)的高性能代码生成包 被许多AOP框架使用 区别于JDK动态代理,cg ...

  5. php中header函数参数的Cache-control:private,no-cache,must-revalidate,max-age是使用方法!

    由于我做的是登录,也就是用户登录每次登陆时都要来访问服务器,不需要在客户机做缓存,于是在网上找了找,发下一下文章不错于是传了上来.网页的缓存是由HTTP消息头中的“Cache-control”来控制的 ...

  6. 嵌入式Linux驱动学习之路(二十一)字符设备驱动程序总结和块设备驱动程序的引入

    字符设备驱动程序 应用程序是调用C库中的open read write等函数.而为了操作硬件,所以引入了驱动模块. 构建一个简单的驱动,有一下步骤. 1. 创建file_operations 2. 申 ...

  7. Eclipse使用svn文章列表

    http://www.cnblogs.com/duanxz/p/3334660.html http://www.cnblogs.com/duanxz/p/3334660.html http://130 ...

  8. time.c 的Java实现(从timestamp计算年月日时分秒等数值)

    time.c的Java实现 public class GMT { public static final int EPOCH_YEAR = 1970; public static final int[ ...

  9. BZOJ 3505 【Cqoi2014】 数三角形

    Description 给定一个nxm的网格,请计算三点都在格点上的三角形共有多少个. 下图为4x4的网格上的一个三角形. 注意三角形的三点不能共线. Input 输入一行,包含两个空格分隔的正整数m ...

  10. cf Round 607

    A.Chain Reaction(DP+二分) 题意:一排有n个灯塔,每个灯塔给出坐标xi和力量yi,每次从最右边依次点亮灯塔,每点亮一个灯塔,它左边的距离它yi范围内的灯塔将受到损坏.现在允许在最右 ...