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

UINavigationController usage #15

Closed
eimantas opened this issue Aug 10, 2017 · 1 comment
Closed

UINavigationController usage #15

eimantas opened this issue Aug 10, 2017 · 1 comment

Comments

@eimantas
Copy link

eimantas commented Aug 10, 2017

How can I set a custom table view controller for the UINavigationController? Here's a thing that I have:

Main.xml

<UITabBarController>

    <UIViewController
        title="Table"
        tabBarItem.title="Table"
        xml="MyTableViewController.xml" />

    <UIViewController
    tabBarItem.title="Scroll"
        xml="ScrollViewController.xml" />
</UITabBarController>

MyTableViewController.xml

<UINavigationController>
    <MyTableViewController
        title="Table">
        <UITableView
            width="100%"
            height="100%"
            rowHeight="44"
            estimatedRowHeight="44"
            >
            <UITableViewCell
                reuseIdentifier="Cell"
                rowHeight="44">
                <UILabel top="8" left="8" text="{row}" />
            </UITableViewCell>
        </UITableView>
    </MyTableViewController>
</UINavigationController>

ScrollViewController

<UINavigationController>
    <ScrollViewController>
        <UIView
            backgroundColor="#faaa"
            width="100%"
            height="100%"
            >
            <UIScrollView
                width="parent.width"
                height="parent.height"
                >
            </UIScrollView>
        </UIView>
    </ScrollViewController>
</UINavigationController>

The bug that I think I found is that if root view controller for navigation controller inherits from view controller all works fine (I have print statement in ScrollViewController.viewDidLoad and it gets printed when the app starts, however the MyTableViewController print statement doesn't get executed and looking from view debugger, the root view controller for the first tab is UITableViewController, but the instance for the second tab is ScrollViewController as it should be.

I have added rowHeight attributes as the rows in the first tabe are only around 20pts high:

simulator screen shot - iphone 7 - 2017-08-10 at 14 48 47

@nicklockwood
Copy link
Owner

Fixed in 0.4.9

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

2 participants