布局之按钮的图片分辨率--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 ...
随机推荐
- 【2016-10-17】【坚持学习】【Day8】【简单工厂模式】
今天学习简单工厂模式, 结构 一个抽象产品 多个具体产品 一个工厂类,通过传入参数,new出不同的产品 代码: abstract class Product { //所有产品类的公共业务方法 publ ...
- 用MonoDevelop开发Linux游戏
鉴于微软将放弃XNA,MonoGame将是喜欢XNA的朋友们的新选择,他是XNA游戏引擎的开源实现,而且是跨平台的,这意味着你可以用他开发OS.android.windows以及linux应用程序,多 ...
- CF733C Epidemic in Monstropolis[模拟 构造 贪心]
C. Epidemic in Monstropolis time limit per test 1 second memory limit per test 256 megabytes input s ...
- POJ1703Find them, Catch them[种类并查集]
Find them, Catch them Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 42416 Accepted: ...
- HBASE 安装法
http://www.cnblogs.com/nexiyi/p/hbase_intro_94.html
- [转]Mac下配置基于SecurID的Cisco IPSec VPN全攻略(有图)
来自: http://www.eefocus.com/Kevin/blog/11-09/230878_53c71.html RSA的SecurID长的是这个样子滴: Mac里面,可以设置VPN, 方法 ...
- cf Round 613
A.Peter and Snow Blower(计算几何) 给定一个点和一个多边形,求出这个多边形绕这个点旋转一圈后形成的面积.保证这个点不在多边形内. 画个图能明白 这个图形是一个圆环,那么就是这个 ...
- echarts在.Net中使用实例(二) 使用ajax动态加载数据
通过上一篇文章可以知道和echarts参考手册可知,series字段就是用来存储我们显示的数据,所以我们只需要用ajax来获取series的值就可以. option 名称 描述 {color}back ...
- JavaScript toLowerCase() 方法 把字符串转换为小写
定义和用法 toLowerCase() 方法用于把字符串转换为小写. 语法 stringObject.toLowerCase() 返回值 一个新的字符串,在其中 stringObject 的所有大写字 ...
- jquery富文本在线编辑器UEditor
UEditor 是由百度「FEX前端研发团队」开发的所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点,开源基于MIT协议,允许自由使用和修改代码. UEditor的功能非常强大,官方 ...