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

Weird LayoutParameters issue #12

Open
topsites opened this issue Mar 28, 2014 · 0 comments
Open

Weird LayoutParameters issue #12

topsites opened this issue Mar 28, 2014 · 0 comments

Comments

@topsites
Copy link

Using MvvmCross, I have a view with many bindings; one of those happen to be a UILabel

new StackPanel(Orientation.Horizontal)
{
    Spacing = 10,
    SubViews = new View[]
    {
        DialPrefix = new Label("DialPrefix", MainStyleType.Header2, AutoSize.WrapContent)
        {
            TextColor = UIColor.LightGray
        },
        PhoneNumber = new Label("PhoneNumber", MainStyleType.Header2)
        {
            // hack: without specifying the height here, this label doesn't get shown with numeric only
            LayoutParameters = new LayoutParameters(AutoSize.FillParent, 20)
        },
    }
},

Weirdness: PhoneNumber is binded with a VM property (which is a string);

Now with PhoneNumber LayoutParameters as AutoSize.WrapContent, if I set the property value to something like "1234", it will not be visible; using SpyTouch, I can see that the label frame has almost no height.

If I set property value to "A123", it will then show up, or "-123"; however " 123" (space before the value) isn't visible.

Setting LayoutParameter Height to a set value solves my problem for now, but it's not neat.

I have a deadline right now, else I would have uploaded a project. I will try to do that soon.

PS: Thanks for this amazing library; some forum says it can only be used with simple layout - well it works great with all my pages, and some are not so simple :)

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