OSChina App代码分析二
来源:互联网 发布:百度的端口号 编辑:程序博客网 时间:2024/05/08 01:23
转载请标明出处:
http://blog.csdn.net/zq2114522/article/details/50346073;
本文出自:【梁大盛的博客】
在第二篇里面我们首先分析OSChinaApp的主布局文件activity_main.xml.
主布局采用DrawerLayout来实现.
主布局据就一个FrameLayou和一个FragmentTabHost.侧拉栏是用一个Fragment填充.快捷按钮是一个ImageView覆盖在FragmentTabHost之上.
布局很简单也很清晰,没什么特别多需要讲解的.但是想写一些布局所引出来的东西.具体看后面的附上的链接.
<android.support.v4.widget.DrawerLayout xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="net.oschina.app.ui.MainActivity" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <FrameLayout android:id="@+id/realtabcontent" android:layout_width="match_parent" android:layout_height="0dip" android:layout_weight="1" /> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/windows_bg" > <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="4dip" > <net.oschina.app.widget.MyFragmentTabHost android:id="@android:id/tabhost" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="4dip" /> <View android:layout_width="match_parent" android:layout_height="10px" android:background="?attr/lineColor" /> </RelativeLayout> <!-- 快速操作按钮 --> <ImageView android:id="@+id/quick_option_iv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:contentDescription="@null" android:src="@drawable/btn_quickoption_selector" /> </FrameLayout> </LinearLayout> <!-- 左侧侧滑菜单 --> <fragment android:id="@+id/navigation_drawer" android:name="net.oschina.app.ui.NavigationDrawerFragment" android:layout_width="@dimen/navigation_drawer_width" android:layout_height="match_parent" android:layout_gravity="start" tools:layout="@layout/fragment_navigation_drawer" /></android.support.v4.widget.DrawerLayout>
0 1
- OSChina App代码分析二
- OSChina App代码分析一
- OSChina App代码分析之摇一摇Demo
- OSChina App代码分析之BaseApplication
- oschina代码结构分析
- 分析开源oschina客户端(二)
- oschina-app 的源码分析-主页面滑动切换
- oschina-app 源码分析-数据缓存(离线功能)
- oschina-app源码分析-提醒标签BadgeView使用方法
- oschina-app源码分析-提醒标签BadgeView使用逻辑流程
- oschina-app源码分析-提醒标签BadgeView使用逻辑流程
- 使用OSChina代码托管管理项目(二)
- kdb代码分析(二)
- vivi代码分析(二)
- eclipse从oschina pull代码
- eclipse提交代码至oschina
- 【oschina android源码分析】总结
- oschina-app源码解析-系统参数保存
- 禁止chrome浏览器自动填充表单的解决方案
- log4j 阻塞 服务 callAppenders
- cocos2dx
- java中的assert关键字
- 修改小程序
- OSChina App代码分析二
- 【图像处理】NEON编程1 - 加载及存储
- 递归与迭代的区别
- Ajax 完整教程 (转)
- 从头认识java-13.9 隐式和显示的创建类型实例
- Next Permutation
- 最短路 hdu1874
- Linux中查看是否有nvdia的显卡
- Single Number III