联系人软件知识点

布局控件篇:
ScrollView:为控件或者布局添加滚动条
android:layout_marginTop:20px距离上方组件的距离,px代表像素点
android:padding="5dip" 其中dips=(pixs*160)/densityDpi



selector是在文件夹drawable中进行定义的xml文件:
主要定义控件在pressed,selected,focused以及平常状态下的属性。

bg_selector.xml文件

<?xml version="1.0" encoding="utf-8" ?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:state_pressed="true"
        android:drawable="@drawable/listlayoutsample12xml_press_image" />
    <item
        android:state_selected="true"
        android:drawable="@drawable/listlayoutsample12xml_focus_image" />
    <item
        android:state_focused="true"
        android:drawable="@drawable/listlayoutsample12xml_focus_image" />
    <item
        android:drawable="@drawable/listlayoutsample12xml_bg_image" />
</selector>

在布局文件中使用它
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
      android:orientation="vertical"
      android:background="@drawable/bg_selector"
      android:paddingRight="13.33dp"
      android:layout_height="65.33dp"
      android:paddingLeft="31.9dp"
      android:gravity="center_vertical">
</LinearLayout>

使用CursorTreeAdapter填充ExpandableListActivity
1.继承cursorTreeAdapter类。
2.实现bindGroupView()[绑定组上的数据]
newGroupView() [设置组上的布局]
getChildrenCursor() [返回子控件的数据]
newChildView() [设置子控件上的布局]
bindChildView() [绑定子控件上的数据]
3.调用setListAdapter(cursorTreeAdapter)填充ExpandableListActivity。


PopupWindow的使用:
1.初始化。调用布局文件显示popupwindow的布局。
view = this.getLayoutInflater().inflate(R.layout.popup_window, null);
pop = new PopupWindow(view, ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);

2.在控件v下方显示popupwindow
pop.showAsDropDown(v); 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值