当前位置: 编程技术>移动开发
本页文章导读:
▪简要Dialog设计 简洁Dialog设计
public static void makeView(Context context, String mTitle, String mContent) {
if (mProDialog == null) {
mProDialog = new Dialog(context,R.style.TANCStyle);
}
mProDialog.setContentView(R.layout.main_dialog);
TextVi.........
▪ Pocket PC 模拟器上网设立 Pocket PC 模拟器上网设置
在确保主机已连上互联网的情况下,按以下步骤设置:1、打开ActiveSync ,点击“文件”——>“连接设置”,在“允许连接到以下其中一个端口”下选择“DMA”。2.........
▪ Mars视频札记——ExpandableListActivity Mars视频笔记——ExpandableListActivity
ExpandableListActivity使用
使用方法(可以和ListActivity进行对比)
创建一个Activity类继承ExpandableListActvity
三个layout
主布局 (注意这里2个id都是android内置的 不.........
[1]简要Dialog设计
来源: 互联网 发布时间: 2014-02-18
简洁Dialog设计
使用的styles.xml中:
这里使用到的背景用一张透明的图片,最后给一个布局文件:
main_dialog.xml:
public static void makeView(Context context, String mTitle, String mContent) { if (mProDialog == null) { mProDialog = new Dialog(context,R.style.TANCStyle); } mProDialog.setContentView(R.layout.main_dialog); TextView text = (TextView) mProDialog.findViewById(R.id.mLoadingDes); text.setText(mContent); mProDialog.show(); }
使用的styles.xml中:
<style name="TANCStyle" parent="@android:style/Theme.Dialog"> <!-- 更换背景图片实现全透明 --> <item name="android:windowBackground">@drawable/bg_dialog</item> </style>
这里使用到的背景用一张透明的图片,最后给一个布局文件:
main_dialog.xml:
<?xml version="1.0" encoding="UTF-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="50dp" android:gravity="center_vertical"> <ProgressBar android:id="@+id/loadProgressBar" android:layout_gravity="center_vertical" android:layout_width="50dp" android:layout_height="50dp" /> <TextView android:id="@+id/mLoadingDes" android:layout_marginLeft="5dp" android:layout_gravity="center_vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/black" /> </LinearLayout>
[2] Pocket PC 模拟器上网设立
来源: 互联网 发布时间: 2014-02-18
Pocket PC 模拟器上网设置
在确保主机已连上互联网的情况下,按以下步骤设置:
1、打开ActiveSync ,点击“文件”——>“连接设置”,在“允许连接到以下其中一个端口”下选择“DMA”。
2、打开 VS2005,点击菜单“工具”——>“设备仿真管理器”,选择一个windows mobile 5.0 PocketPC 模拟器。在右键菜单中点击“连接”。等模拟器启动后,再点击“插入底座”,此时,通过ActiveSync来连接到模拟器,并进行数据同步。
3、在模拟器中,点击“开始”——>“设置”,点击“连接”选项卡。
(1)选择“网卡”:
“我的网卡连接到”选“默认单位设置”。
在“点击适配器以修改设置:”下面选“AsyncMac NDISWAN Miniport”,选中“使用服务器分配的IP地址”,点击右上角的“ok”,提示“新设置将在下次使用适配器时应用。如果适配器当前插在设备中,请先移除,然后重新插入适配器以应用设置。”,点击“ok”,“ok”。
(2)在“连接”选项卡中选择“连接”:
在“高级”选项卡中,点击“选择网络”,在“在程序自动连接到Internet时,使用:”下面选“单位设置”,默认是“Internet设置”,然后,连续点击右上角的“ok”,“ok”,“X”返回。
4、此时,就可以上网了。依次点击“开始”——>“Internet Explorer”——>“收藏夹”——>“MSN Mobile”,就会出现页面了。如还打不开网页,可在“设备仿真器管理器”中选中该模拟器,先点击右键菜单中的“移除底座”,再点击“插入底座”,重新与ActiveSync连接一次,就没问题了。
在确保主机已连上互联网的情况下,按以下步骤设置:
1、打开ActiveSync ,点击“文件”——>“连接设置”,在“允许连接到以下其中一个端口”下选择“DMA”。
2、打开 VS2005,点击菜单“工具”——>“设备仿真管理器”,选择一个windows mobile 5.0 PocketPC 模拟器。在右键菜单中点击“连接”。等模拟器启动后,再点击“插入底座”,此时,通过ActiveSync来连接到模拟器,并进行数据同步。
3、在模拟器中,点击“开始”——>“设置”,点击“连接”选项卡。
(1)选择“网卡”:
“我的网卡连接到”选“默认单位设置”。
在“点击适配器以修改设置:”下面选“AsyncMac NDISWAN Miniport”,选中“使用服务器分配的IP地址”,点击右上角的“ok”,提示“新设置将在下次使用适配器时应用。如果适配器当前插在设备中,请先移除,然后重新插入适配器以应用设置。”,点击“ok”,“ok”。
(2)在“连接”选项卡中选择“连接”:
在“高级”选项卡中,点击“选择网络”,在“在程序自动连接到Internet时,使用:”下面选“单位设置”,默认是“Internet设置”,然后,连续点击右上角的“ok”,“ok”,“X”返回。
4、此时,就可以上网了。依次点击“开始”——>“Internet Explorer”——>“收藏夹”——>“MSN Mobile”,就会出现页面了。如还打不开网页,可在“设备仿真器管理器”中选中该模拟器,先点击右键菜单中的“移除底座”,再点击“插入底座”,重新与ActiveSync连接一次,就没问题了。
[3] Mars视频札记——ExpandableListActivity
来源: 互联网 发布时间: 2014-02-18
Mars视频笔记——ExpandableListActivity
ExpandableListActivity使用
使用方法(可以和ListActivity进行对比)
创建一个Activity类继承ExpandableListActvity
三个layout
主布局 (注意这里2个id都是android内置的 不是+id)
包含<ExpandableListView> 注意其中android:id="@id/android:list" 还有一个android:drawSelectorOnTop="false"(选中时是否遮盖文字)
<TextView android:id="@id/android:empty"> 当无数据时
一级目录布局
二级目录布局(条目item样式)
创建Adapter
将simpleExpandableListAdapter对象设置给当前ExpandableListActivity
setListAdapter(adapter);
SimpleExpandableListAdapter使用
为ExpandableListActivity提供数据
//定义List 为一级条目提供数据
List<Map<String, String>> groups=new ArrayList<Map<String, String>>();
需要几个条目 生成几个Map对象
Map<String, String> m1=new HashMap<String, String>();
m1.put(group,Group1);
m2.put(group,Group2);
groups.add(m1);
groups.add(m2);
//定义List 设置二级子条目 一个子条目一个List 一个项 一个Map
方法同上 建List(child1 child2)和Map(child:child1Data1;child:child1Data2)
//定义一个List 存储所有二级条目数据
*List<List<Map<String, String>>> childs = new ArrayListM<List<Map<String, String>>>();
childs.add(child1);
childs.add(child2);
//生成一个SimpleExpandableListAdapter对象
new SimpleExpandableListAdapter(...);
参数包括
(context上下文对象,一级条目List对象,一级条目布局,
new String[]{"groups"})指定一级条目数据的key,new int[]{R.id.groupTo}指定一级条目数据显示的控件id,
二级条目的数据childs,二级条目布局,二级条目数据key(child),二级条目控件id}
最终目录结构
Group1
child1Data1
child1Data2
Group2
child2Data
最新技术文章: