| 342 | } |
| 343 | |
| 344 | void ListView::insertCustomItem(Widget* item, ssize_t index) |
| 345 | { |
| 346 | if (-1 != _curSelectedIndex) |
| 347 | { |
| 348 | if (_curSelectedIndex >= index) |
| 349 | { |
| 350 | _curSelectedIndex += 1; |
| 351 | } |
| 352 | } |
| 353 | _items.insert(index, item); |
| 354 | onItemListChanged(); |
| 355 | |
| 356 | ScrollView::addChild(item); |
| 357 | |
| 358 | remedyLayoutParameter(item); |
| 359 | requestDoLayout(); |
| 360 | } |
| 361 | |
| 362 | void ListView::removeItem(ssize_t index) |
| 363 | { |