首页 > 其他 > 详细

今日小结 4.7

时间:2016-04-08 07:46:32      阅读:235      评论:0      收藏:0      [点我收藏+]
  • 优化ToolBar,Menu
  • 绑定照片到RecyclerView中 —— OK
  • 学习Fragment ——OK
  • 按钮的点击变化

1.Fragment将每一个视图部分(Fragment)的视图设置(Fragment layout)和程序编写(XXFragment.class)相分开 ,

提高了代码的可读性,复用性和维护性

 

2.使用RelativeLayout + LinearLayout 嵌套完成四个按钮底部均匀放置,

使用RelativeLayout完成放置底部操作 

android:layout_alignParentBottom="true"

设置权重,完成四个按钮的均匀对齐

android:layout_weight="1"
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">


    <LinearLayout
        android:layout_alignParentBottom="true"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ImageButton
            android:id="@+id/ib_bottombar_add"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@android:drawable/ic_menu_add"
            android:scaleType="center" />

        <ImageButton
            android:id="@+id/ib_bottombar_edit"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@android:drawable/ic_menu_edit"

            android:scaleType="center" />

        <ImageButton
            android:id="@+id/ib_bottombar_delete"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"

            android:background="@android:drawable/ic_menu_delete"

            android:scaleType="center" />

        <ImageButton
            android:id="@+id/ib_bottombar_more"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"

            android:background="@android:drawable/ic_menu_more"
            android:scaleType="center" />

        </LinearLayout>


</RelativeLayout>

 



今日小结 4.7

原文:http://www.cnblogs.com/Chongger/p/5363282.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!