xamarin / AndroidSupportComponents

Xamarin bindings for Android Support libraries - For AndroidX see https://github.com/xamarin/AndroidX
MIT License
146 stars 56 forks source link

Constraint layout doesn't appear correctly in the designer #102

Closed ikazrima closed 5 years ago

ikazrima commented 6 years ago

Xamarin.Android Version (eg: 6.0):

VS Community 2017 15.6.6

Operating System & Version (eg: Mac OSX 10.11):

Windows 10

Support Libraries Version (eg: 23.3.0):

Android Support 27.0.2 Android Constraint Layout 1.1.0

Describe your Issue:

Elements doesn't properly align in the designer, ignored defined constraints. Layout however appears correctly in device. Downgrading to 1.0.2.2 still produce the same issue.

Previous version of VS does have the layout appears correctly in designer.

Steps to Reproduce (with link to sample solution if possible):

Put an element inside a constraint layout (width fill parent, height fill parent). Set element width to 0dp, constraint left to left of parent, constraint right to right of parent.

Include any relevant Exception Stack traces, build logs, adb logs:

image

VS bug #732429

newky2k commented 6 years ago

@ikazrima Have you tried this in the latest version Visual Studio, which is 15.7.6 on windows.

ikazrima commented 6 years ago

@newky2k By chance I've just started a new project. Upgraded VS to 15.7.6 and also the latest packages from Nuget. It's the same result, or might be worse?

Nothing is aligned correctly so I had to change my workflow. Now all my designs are done in Android Studio, then ported to Xamarin. This is the fastest and reliable way for me now.

newky2k commented 6 years ago

@ikazrima if you could put together a very small sample and send the link so that we can investigate further. I suspect this is not strickly and issue with the support libraries but soemthing to do with the designer itself. but if we have the sample we can look at it and reassign if neccesary.

thanks

ikazrima commented 6 years ago

@newky2k It's not a full project, but a stripped down of my project resources. gdrive link, I included screenshots of Android Studio & VS in the folder.

newky2k commented 6 years ago

@ikazrima Thank you for the providing the sample, i will look into for and go from there.

Redth commented 5 years ago

@garuma do you have any input on this one?

garuma commented 5 years ago

We are working on better support for ConstraintLayout overall in the Android designer. One thing that might not be working in the version you are using is parent constraint (i.e. when the value of a layout_constraint*To* is "parent") in that case try to use a named constraint instead (with the proper @id/ syntax).

Redth commented 5 years ago

Closing this as this is something the designer team is tracking, and not something we can fix or improve in the bindings for the libraries themselves.