Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ListView with iOS's Large Titles crashes on scroll down #305

Open
lumirth opened this issue Jul 24, 2022 · 0 comments
Open

Using ListView with iOS's Large Titles crashes on scroll down #305

lumirth opened this issue Jul 24, 2022 · 0 comments

Comments

@lumirth
Copy link

lumirth commented Jul 24, 2022

edited.mov

As can be seen in this video, the application crashes when attempting to scroll down with large titles enabled. This is probably(maybe possibly sorta kinda, not really sure) linked to something going wrong when it tries to move the text to the normal action bar position title upon scrolling down. Strangely enough, it is scrolling down specifically that causes the crash, not scrolling up. Logs and code below.

The code of the functioning scrolling page:

<scrollView>
    <stackLayout class="p-20" height="1000">
      <label text="  PAGE" class="h1 text-center"/>
      <label text="  PAGE" class="h2 text-center" textWrap="true"/>
      <label text="  PAGE" class="h1 text-center"/>
      <label text="  PAGE" class="h2 text-center" textWrap="true"/>
      <label text="  PAGE" class="h1 text-center"/>
      <label text="  PAGE" class="h2 text-center" textWrap="true"/>
    </stackLayout>
  </scrollView>

The code of the offending page:

<listView items="{items}">
  <Template let:item>
    <label text="{item}" />
  </Template>
</listView>

<script>
   ... see below
</script>
  import { ScrollView, StackLayout } from '@nativescript/core'
  import { Template } from 'svelte-native/components'

  let items = ["one", "two", "three"]

I'm using bottom navigation in the following manner, if it's relevant:

<page>
    <actionBar title="ActionBar Large Title" flat=true />

    <bottomNavigation height="400px" selectedIndex="0">
        <tabStrip>
            <tabStripItem>
                <label text="Pagewithnolistview" />
            </tabStripItem>
            <tabStripItem>
                <label text="Pagewithlistview" />
            </tabStripItem>
            ...
        </tabStrip>
        
        <tabContentItem>
            <gridLayout>
                <Pagewithnolistview />
            </gridLayout>
        </tabContentItem>
        <tabContentItem>
            <gridLayout>
                <Pagewithlistview />
            </gridLayout>
        ...
    </bottomNavigation>
</page>

In the script tab of the navigation-containing page is the following(the code to enable large titles):

    export function onLoaded(args: EventData) {
        const page = <Page>args.object;
        
        if (isIOS) {
            page.frame.ios.controller.navigationBar.prefersLargeTitles = true;
        }
    }

Logs(may contain some junk from some console.log's I have lying around):

CONSOLE LOG: Loading inspector modules...
CONSOLE LOG: Finished loading inspector modules.
(RunningBoardServices) [com.apple.runningboard:connection] Identity resolved as application<org.nativescript.myapp>
CONSOLE LOG: *: store -> store()
(UIKitCore) [com.apple.UIKit:AppLifecycle] sceneOfRecord: sceneID: sceneID:org.nativescript.myapp-default  persistentID: E0FB41CC-91EC-4F27-A819-23F7634486D3
CONSOLE LOG: *: store -> init()
(UIKitCore) [com.apple.UIKit:KeyWindow] Window did become application key: UIWindow: 0x1375422a0; contextId: 0x9932CACA; scene identity: com.apple.frontboard.systemappservices::sceneID%3Aorg.nativescript.myapp-default
(UIKitCore) [com.apple.UIKit:AppLifecycle] sceneOfRecord: sceneID: sceneID:org.nativescript.myapp-default  persistentID: E0FB41CC-91EC-4F27-A819-23F7634486D3
(UIKitCore) [com.apple.UIKit:AppLifecycle] sceneOfRecord: sceneID: sceneID:org.nativescript.myapp-default  persistentID: E0FB41CC-91EC-4F27-A819-23F7634486D3
(UIKitCore) [com.apple.UIKit:AppLifecycle] sceneOfRecord: sceneID: sceneID:org.nativescript.myapp-default  persistentID: E0FB41CC-91EC-4F27-A819-23F7634486D3
(UIKitCore) [com.apple.UIKit:KeyWindow] Scene became target of keyboard event deferring environment: UIWindowScene: 0x137535f20; scene identity: com.apple.frontboard.systemappservices::sceneID%3Aorg.nativescript.myapp-default
(UIKitCore) [com.apple.UIKit:AppLifecycle] sceneOfRecord: sceneID: sceneID:org.nativescript.myapp-default  persistentID: E0FB41CC-91EC-4F27-A819-23F7634486D3
CONSOLE LOG: *: store -> activate() 1
CONSOLE LOG: set icon-i
CONSOLE LOG: set icon-a
CONSOLE LOG: set icon-i
CONSOLE LOG: set icon-i
***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error: Uncaught Error: UITableView dataSource returned a nil cell for row at index path: <NSIndexPath: 0xb4b36feb0267431e> {length = 2, path = 0 - 0}. Table view: <UITableView: 0x13c01a600; frame = (0 0; 375 667); clipsToBounds = YES; tag = 30; gestureRecognizers = <NSArray: 0x6000010d3690>; layer = <CALayer: 0x600001ec9540>; contentOffset: {0, -115.5}; contentSize: {375, 132}; adjustedContentInset: {115.5, 0, 49, 0}; dataSource: <DataSource: 0x600001c9cc30>>, dataSource: <DataSource: 0x600001c9cc30>
at
_setNativeViewFrame(file:///app/vendor.js:20839:24)
at layoutNativeView(file:///app/vendor.js:20868:14)
at layout(file:///app/vendor.js:20755:18)
at layoutChild(file:///app/vendor.js:22945:15)
at layoutView(file:///app/vendor.js:22720:69)
at UILayoutViewController.viewDidLayoutSubviews(file:///app/vendor.js:22594:23)
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Uncaught Error: UITableView dataSource returned a nil cell for row at index path: <NSIndexPath: 0xb4b36feb0267431e> {length = 2, path = 0 - 0}. Table view: <UITableView: 0x13c01a600; frame = (0 0; 375 667); clipsToBounds = YES; tag = 30; gestureRecognizers = <NSArray: 0x6000010d3690>; layer = <CALayer: 0x600001ec9540>; contentOffset: {0, -115.5}; contentSize: {375, 132}; adjustedContentInset: {115.5, 0, 49, 0}; dataSource: <DataSource: 0x600001c9cc30>>, dataSource: <DataSource: 0x600001c9cc30>
at
_setNativeViewFrame(file:///app/vendor.js:20839:24)
at layoutNativeView(file:///app/vendor.js:20868:14)
at layout(file:///app/vendor.js:20755:18)
at layoutChild(file:///app/vendor.js:22945:15)
at layoutView(file:///app/vendor.js:22720:69)
at UILayoutViewController.viewDidLayoutSubviews(file:///app/vendor.js:22594:23)
', reason: '(null)'
*** First throw call stack:
(
0   CoreFoundation                      0x000000<>

I have tried things like putting the listView inside a layout or a scrollview, but depending on the type it either causes the same issue, causes the same issue but only if you scroll down farther, or allows scrolling but doesn't change the title size dynamically like it should.

Entirely possible it's an issue with NativeScript itself? Unfortunately, I don't have the expertise to tell. Any help or direction is appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant