You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<SearchBar> Is not showing at all on Android >= 7.0 . I've tested on Emulator with 7.0 API 24, 7.1.1 API 25 and on a device with 7.0. I'll log an issue, but I'm writing you here because I'm pretty sure that this problem was occuring on my phone some months ago with {N} 2.5 + Android 7.0 .
Working as expected on lower Android versions.
PS: Testing with SearchBar inside the page not in the ActionBar
@NickIliev After some more testing I've noticed that the control does not init with default sizes. What I mean is that if the control is inside layout with auto size for example:
The SearchBar is not displayed (it's hidden with height=0 I guess) -> only the Label is visible. If i change the grid to <GridLayout rows="*, *"> or hardcode a height=50 on the SearchBar then it is visible.
Sorry for the initial misleading info, but I think that this is a problem too because the SearchBar control is behaving differently from the other controls
@ADjenkov you are right - some of the controls like ListView needs to be initialized with size or the parents in which they are nested needs to have a size so they can be rendered as expected. These limitations are coming from the native design of the controls that lies behind ListView.
However, this should not be the case for SearchBar - I have modified my application using your snippet you provided and the SearchBar is still visible for iOS (10.2) and Android (API25).
@ADjenkov I can confirm that indeed the SearchBar is not showing on API-24 if some size is not explicitly set (either for its container or for the SearchBar itself). Working as expected on API25 and all API levels before API23 We will need some additional time to investigate if this is not a specific behavior of android.wdiget.SearchView for API-24 and will post the info here.
App demonstrating the issue (only on API 24) here. (works w/ API == 25 && API <= 23)
As a temporary workaround you can set only the height of your SearchBar for Android API 24
e.g.
XML
<SearchBar row="0" loaded="onSearchBarLoaded" />
code behind
export function onSearchBarLoaded(args: EventData) {
let searchBar = <SearchBar>args.object;
if (androidApp && (android.os.Build.VERSION.SDK_INT == 24))) {
searchBar.height = 50;
}
}
changed the title [-]SearchBar is not displayed on Android >= 7.0[/-][+]SearchBar is not displayed - Android API 24 (works w/ API == 25 && API <= 23)[/+]on May 29, 2017
changed the title [-]SearchBar is not displayed - Android API 24 (works w/ API == 25 && API <= 23)[/-][+]SearchBar is not displayed - Android API 24 [/+]on May 29, 2017
Btw , on my phone Sony Xperia Compact with Android 7.0.0 I'm not able to display it with even when I'm setting hardcoded sizes (height="50") (Tested on another 7.1.2 Nexus device and it works)
Activity
NickIliev commentedon May 29, 2017
@ADjenkov please share the code that you are using for the XML page.
I have tested the SearchBar in both API25 and API24 and it works as expected on my side. Here is the used test application.
ADjenkov commentedon May 29, 2017
@NickIliev After some more testing I've noticed that the control does not init with default sizes. What I mean is that if the control is inside layout with
autosize for example:<GridLayout rows="auto, *"> <SearchBar row="0" id="searchBar" hint="Search" text="" clear="onClear"></SearchBar> <Label row="1" text="Test"></Label> </GridLayout>The SearchBar is not displayed (it's hidden with height=0 I guess) -> only the Label is visible. If i change the grid to
<GridLayout rows="*, *">or hardcode aheight=50on theSearchBarthen it is visible.Sorry for the initial misleading info, but I think that this is a problem too because the
SearchBarcontrol is behaving differently from the other controlsNickIliev commentedon May 29, 2017
@ADjenkov you are right - some of the controls like ListView needs to be initialized with size or the parents in which they are nested needs to have a size so they can be rendered as expected. These limitations are coming from the native design of the controls that lies behind ListView.
However, this should not be the case for SearchBar - I have modified my application using your snippet you provided and the SearchBar is still visible for iOS (10.2) and Android (API25).
ADjenkov commentedon May 29, 2017
@NickIliev I've just tested again. It is ok on Android 6.0 API 23, but not visible in Android 7.0 API 24
Here is an app search-bar-test-tsc.zip
Also tested on device.
NickIliev commentedon May 29, 2017
@ADjenkov I can confirm that indeed the SearchBar is not showing on API-24 if some size is not explicitly set (either for its container or for the SearchBar itself). Working as expected on API25 and all API levels before API23 We will need some additional time to investigate if this is not a specific behavior of android.wdiget.SearchView for API-24 and will post the info here.
App demonstrating the issue (only on API 24) here. (works w/ API == 25 && API <= 23)
As a temporary workaround you can set only the height of your SearchBar for Android API 24
e.g.
XML
code behind
[-]SearchBar is not displayed on Android >= 7.0[/-][+]SearchBar is not displayed - Android API 24 (works w/ API == 25 && API <= 23)[/+]ADjenkov commentedon May 29, 2017
Yes, I've already hardcoded id for my scenario.
Тhanks for your time!
[-]SearchBar is not displayed - Android API 24 (works w/ API == 25 && API <= 23)[/-][+]SearchBar is not displayed - Android API 24 [/+]ADjenkov commentedon May 30, 2017
Btw , on my phone Sony Xperia Compact with Android 7.0.0 I'm not able to display it with even when I'm setting hardcoded sizes (
height="50") (Tested on another 7.1.2 Nexus device and it works)SvetoslavTsenov commentedon Jun 14, 2017
The fix is already available in tns-core-modules@next and will also be released with tns-core-modules@3.1.0
lock commentedon Aug 28, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.