标签:gets 默认 hover tar dataset tin fhe ber lis
1.listview的模板template中,需要增加defHeight属性,即默认高度,同时,不能出现itemHeight属性,否则动态高度会失效
2.数据适配器中,重写getViewDesiredSize,类似下面的代码
DWORD dwState = pItem->GetState();
if((dwState & WndState_Check) ||
(dwState & WndState_PushDown))
{
return CSize(0,80);
}
return CSize(0,40);
3.getview中,订阅行的状态变化消息
pItem->GetEventSet()->subscribeEvent(EventSwndStateChanged::EventID,
Subscriber(&CXX::OnItemStateChanged,this));
4.状态变化时关联下面的函数
bool CTodayTaskerListAdapter::OnItemStateChanged(EventArgs *e)
{
EventSwndStateChanged *e2 = sobj_cast<EventSwndStateChanged>(e);
if(!e2->CheckState(WndState_Hover)) return false;
//通知界面重绘
notifyDataSetInvalidated();
return true;
}
标签:gets 默认 hover tar dataset tin fhe ber lis
原文地址:http://www.cnblogs.com/thq3322110/p/6225228.html