MAUI - A big problem - lack of responsiveness... #20047
-
Hi everyone, I've been doing programming for many, many years now, so I have a rough idea about coding and these frameworks. I had a look at MAUI about a year ago or so when it was released, and honestly, I found it pretty shocking. I thought; "Yes, far from complete, but one to keep an eye on.". Anyway, I came back to it 3 days ago, and well done, I think it's very good! I feel as though I've got to grips with it in just 3 days! I can see the benefits of MAUI, it's powerful, it's relitively easy, and for by far the most part, it works well. It's great! However, I have a major concern with MAUI - responsiveness. In 2024, arguably, apps being responsive is more important than them being cross-platform. I've come to learn, to my surprise that MAUI doesn't offer a solution to full responsiveness, and it really, really should. I can see the layouts, I can see the views concept, but it doesn't work! There's no solution for dealing with a changing orientation! We're writing apps now for phones and tablets, and people do want to change orientation. This is a really basic thing that apps must be able to handle now. Without this, I can't see how MAUI will be successful. I've looked through the documentation, I've looked through forums here also. There's no reasonable, native solution to be found. There are a few guys who have noticed the problem and sought to get over it, but they're using a hundred lines of code. It shouldn't be like this! We can make incredibly responsive web apps with the excellent Bootstrap. This is a really important feature. It miust be resolved if people want MAUI to be taken seriously. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 18 replies
-
Huh? My apps support change of orientation without any extra code. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
For landscape, what changes are you looking to see? Do you have designs for that? |
Beta Was this translation helpful? Give feedback.
-
This is how I've been handling dynamic change of orientation, perhaps not the best way of doing things but it works. I surface a number of ObservableProperties so they can be bound to in XML and, hence, the page layout/sizes/label size can change in real time (via handling the 'OnMainDisplayInfoChanged' event). We have a very specific device target, i.e. a tablet with certain dimensions, hence the hard-coded numbers for label size.
|
Beta Was this translation helpful? Give feedback.
-
Maybe you can take a look to AdaptiveTrigger |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hi Everyone. On second thoughts, this solution is not too good. I've come too the conclusion that MAUI simply does not fully support responsiveness. Basically, the accepted solution is either to use triggers, or to use multiple views. Triggers allow you to change attributes of some object. For example, you could have a button with a trigger. When a trigger is triggered on orientation change, you can change the attribute "width" to 100%, whereas in portrait, it could be 50%. So you ahve one view that can change. The other option is multiple views. The idea of this is that you have a view for portrait and a completely different view for landscape. Here you ahve two things and just hide one when orientation has changed. Neither of these fixes are straight forward. The first fix simply doesn't work in practice. You need to be able to change whole parent objects rather than simply change attributes. The second fix isn't simple. you need to double up controls, and not only that, it's not a case of simply making one view invisible and the other visible, because you can onyl have one view in the page! What you have to do is mess about in the code behind. Neither solutions are sufficiently elegant. In my opinion, this is aserious issue that needs to be addressed. I'm going to start new contracts in a few weeks. I can't offer this sort of thing to my clients! It must look good and work well for users and it must be quick and easy for me to make, otherwise I'm working for cheap! |
Beta Was this translation helpful? Give feedback.
-
If you want to do it the wrong way, feel free to 'mess about' in the code behind. Or use a bindable property on your VM. It really is very simple, I don't know why you are making this more complex than it is. |
Beta Was this translation helpful? Give feedback.
Thanks, so you are looking for 2 different layouts then. The first has a scrollview, the 2nd doesn't.
I normally handle this by binding IsVisible to 2 different layouts and switch which is visible in the VM when the orientation changes.