zoukankan      html  css  js  c++  java
  • 布局之按钮的图片分辨率--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>

     

    工作如同河川,自闲暇的深海觅得圆满。
  • 相关阅读:
    PHP7.27: connect mysql 5.7 using new mysqli
    PHP: Browser, Operating System (OS), Device, and Language Detect
    PHP 在WIN10 下配置
    MySQL chartset
    學習Echart 2.2.7
    The open source JavaScript graphing library that powers Plotly
    D3.js 制作中国地图
    FastReport.Net
    CSS 3D transforms
    SparkCore的调优之开发调优
  • 原文地址:https://www.cnblogs.com/phpli/p/5784754.html
Copyright © 2011-2022 走看看