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>

     

    工作如同河川,自闲暇的深海觅得圆满。
  • 相关阅读:
    recommend a wait button on web page
    ref: 这正是BI工具的精髓:它不是让你相信自己所知道的,而是促使你去思考更多的问题和疑惑。
    asp.net 中使用iframe动态加载页面
    forbid cache page in asp.net
    转贴: 想使你的公司有所创新吗?
    treeview 的使用心得
    ref: 九大数据仓库方案特点比较
    recommend a cool calendar
    Servlet与Jsp学习笔记10、Localized
    重复表的操作
  • 原文地址:https://www.cnblogs.com/phpli/p/5784754.html
Copyright © 2011-2022 走看看