[SailfishDevel] Use same header item instance in multiple views
Michael Neufing
michael at neufing.org
Fri Jul 22 18:20:34 UTC 2016
Thanks for the fast reply, Andrey!
Maybe I don't get the idea behind your suggestion, but I can't see how
that should help, because the reparenting is done dynamically during
run-time, not during creation-time.
Br,
Michael
Am 22.07.2016 19:46, schrieb Andrey Kozhevnikov:
> Wrapping your list views into loader components can probably help you
> :)
>
> ------ Исходное сообщение ------
> От: "Michael Neufing" <michael at neufing.org>
> Кому: devel at lists.sailfishos.org
> Отправлено: 22.07.2016 23:43:41
> Тема: [SailfishDevel] Use same header item instance in multiple views
>
>> Hi together!
>>
>> I am trying to use the same SearchField instance in multiple views as
>> header item.
>> When the page opens, a GridView is displayed with popular content. A
>> SearchField is used as header.
>>
>> When the user focuses and/or writes text into the search field, the
>> page should go into "search mode" where the GridView is hidden and a
>> ListView with the search results is displayed.
>> The goal is, that no screen space is wasted while scrolling. Therefore
>> I want to have the same SearchField as header on both views.
>>
>> I tried to add a placeholder item into both views with the same height
>> as the SearchField and reparent the SearchField according to the mode
>> either into the GridView or the ListView.
>> While that technically works (scrolling, etc), the SearchField loses
>> it's focus during that process and the user has to re-focus the field
>> in order to be able to type more text.
>> Even calling "forceActiveFocus()" or setting "focus = true" on the
>> SearchField after the reparenting does not work.
>>
>> Please see [1] for a code example.
>>
>> Can anybody help? I want to avoid that the SearchField is always
>> visible when scrolling.
>>
>> Thanks.
>>
>> Br,
>> Michael
>>
>> [1] http://pastebin.com/fhAdELHN
>> _______________________________________________
>> SailfishOS.org Devel mailing list
>> To unsubscribe, please send a mail to
>> devel-unsubscribe at lists.sailfishos.org
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to
> devel-unsubscribe at lists.sailfishos.org
More information about the Devel
mailing list