设为首页 加入收藏

TOP

Android下文件资源管理器雏形实现
2014-11-24 07:43:29 来源: 作者: 【 】 浏览:1
Tags:Android 文件 资源管理 雏形 实现

xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".FileExplorerActivity" >
android:id="@+id/currentTv"
android:layout_alignParentTop="true"
android:clickable="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:id="@+id/fileLv"
android:layout_below="@id/currentTv"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">




布局很简单,就是放置了一个ListView控件,这里要注意的是,ListView标签下不能再放入其他的子控件。内容是通过子布局和Adapter来显示的。

2.ListView中的子布局file_list_item.xml


< xml version="1.0" encoding="utf-8" >
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
android:id="@+id/filename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>



子布局也很简单,就是在水平方向上左边显示一个图标,用来显示文件夹或文件图标,右边显示文件名。


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Android AIDL的重新理解 下一篇Android下实现一个手机监控摄像头

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Asus Armoury Crate (2025-12-26 02:52:33)
·WindowsFX (LinuxFX) (2025-12-26 02:52:30)
·[ Linux运维学习 ] (2025-12-26 02:52:27)
·HTTPS 详解一:附带 (2025-12-26 02:20:37)
·TCP/IP协议到底在讲 (2025-12-26 02:20:34)