-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Enhancement] Add Maximum(Width/Height)Request to VisualElement #2000
Comments
Are we really doing this? There is already lots of confusion about the minimum(height/width)request properties. I think it's better to spend time in introducing a min and max width/height which does what people expect it to do (like min/max height/width in css) instead of introducing even more properties that people will misunderstand. Better yet, this proposal seems to be what people would expect the minimumheightrequest property to do |
I agree with you about the expected behavior of the existing property being backwards, and now this one would be as well. We can't know for certain how many developers have implemented the existing property, knowing the actual effect it has on their layouts. So any breaking change would have to be done through making the existing property obsolete and find a new name for both, and make it clear to devs that this breaking change has happened. I'm quite happy settling for what I proposed above. However you are more than free to make a new issue about this with your own suggestions. (And would be good to link to this issue from there) |
I'm stuck trying to make a cell in a grid to have a shrinkable size, this property would be very helpful for that use case. In a grid for instance it would separate two columns by a prefixed space, and only if the size of the elements in other columns is big enough it should shrink all the way down to zero, so that the grid spacing would be the only space left. |
Any progress on adding a true max/min height property? I don't care what it's called at this point since all discussions seem to end around the 'correct' naming. This features has been requested both directly and indirectly over over again* since 2016, what is the hold up? *and I mean over and over again: https://stackoverflow.com/questions/37662318/set-minimum-button-width-in-xamarin-forms-or-ios |
I came across this issue while working on docs for the
So by my tests and understanding, setting a |
More precisely, they are the last to shrink: controls with specified minimums will be shrunk first.
90%+ of the time, that is what one doesn't want to have to do. The frequent complaint re lack of a "true" Minimum option is a desire to let a control seek its desired size, but to not let it fall below a minimum. This means not setting a fixed Width. WidthRequest doesn't act like Maximum would. Rather, it forces a control to consume that space (if available), whether it wants that space or not. This is non-adaptive non-responsive behavior. In summary, it isn't possible to get the desired behavior: |
@rdaniel0 The formula for Maximum should be MIN(Calculated, MaximumRequest). That is, it would limit the size. Your MAX formula would always force it to Maximum - a pointless option to have. @PaulVrugt - almost certainly, what the issue intended, and all the up-voters also mean, is a "true" Maximum option (and a "true" Minimum option to go with it), not another misnamed option. |
@MappingSteve that's exactly what I said I'm my comment. The properties should work the same as they do in css. That's also what I proposed in #2536 |
are there any news since the last 2 years? |
This comment has been minimized.
This comment has been minimized.
I wonder how many times this has been asked in multiple forums, because apart from the cited list, #1862 (and God knows how many others) makes reference to basically the same idea, and the response pretty much ranges from a flat no (and a very stackoverflow reason of why (Using (Width/Height)Request is not a solution)), to radio silence The only sparks of real communication are the label/Project updates, but that's not a proper answer and doesn't mean we are getting this functionality. I know renaming the properties is a breaking change (but a more appropriate naming scheme, should be pretty easy to fix, the only ones affected we should be active project developers), but this option is the next best pick. Can we get an elaborated answer about the status of this, please? @samhouts @kingces95 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hey everyone, thanks for all the engagement here and sorry that this somehow didn't catch our attention. As already pointed out, this is going to change heavily in .NET MAUI. I would suggest you go check out how it works there and if you still would like to see changes, make suggestion on what you would like to see. With Xamarin.Forms now being in maintenance mode we're not going to change anything about it here. I did put this issue on my list so we can go through all the suggestions and ideas here and see if and how we can address them for .NET MAUI or to which extend we might already have done that. |
Hi everyone! I recently encountered this obstacle and came up with a solution in the form of a custom ContentView class: https://gist.github.com/jedusei/c74df567822c46e70c9e1931be9bfbc1 |
Description
It would be nice to have counterparts to the existing Minimum(Width/Height)Request properties.
Maximum(Width/Height) should do the following calculation:
VisualElement.(Width/Height) = Max(Maximum(Width/Height)Request, VisualElement.(Width/Height));
Expected Behaviour
The VisualElement should select the maximum size if it's measure is smaller; otherwise grow as the measure requires.
The text was updated successfully, but these errors were encountered: