.NET MAUI软键盘在Android上占用了页面的一半,为什么?

huangapple go评论112阅读模式
英文:

.NET MAUI Soft keyboard wipes out half the page on android why?

问题

当软键盘弹出时,它会像在Android 13上那样擦掉页面的一半。键盘擦掉了页面的一半

我希望键盘可以弹出和收回而不影响页面。我尝试了在键盘弹出时隐藏我的collectionView,并在键盘收回时取消隐藏它,但效果不太好。只有在某种方式重新加载时才能修复,比如当我将被擦掉的部分滚出视图,然后再滚回来。

**更新:问题是collectionView的ItemsLayout设置为“HorizontalList”,而我的项目使用的是.NET 6(默认的ItemsLayout是VerticalList,没有问题)。但我将我的项目升级到.NET 7,方法是在我的项目的csproj文件中将所有对.NET 6的引用更改为.NET 7。希望对将来的某人有所帮助!

英文:

when soft keyboard pops up, it wipes out half the page like so on android 13. Keyboard wipes out half the page

i expect the keyboard to pop up and down without affecting the page . I've tried hiding my collectionView when keyboard pops up and Unhide it when keyboard goes down but it doesn't work very well. it only gets fixed when somehow it gets reloaded, like if i scroll the wiped section out of view and i scroll it back in

**UPDATE the problem was collectionView's ItemsLayout="HorizontalList" and my project was on .net6 (didnt have any issues with the default ItemsLayout default which is VerticalList) but i upgraded my project to .net7 by going into csproj file in my project changing any reference to net6 with net7
hope it helps someone in the future!

答案1

得分: 1

问题出在我的帖子中已经解释过了:

问题出在collectionView的ItemsLayout="HorizontalList",而我的项目是在.net6上(默认的ItemsLayout是VerticalList,没有任何问题)。

我通过将项目升级到.net7来解决这个问题,方法是进入我的项目中的csproj文件,并将所有引用net6的地方改成net7。

希望对将来的某人有所帮助!

英文:

As i've explained in my post :

The problem was collectionView's ItemsLayout="HorizontalList" and my project was on .net6 (didnt have any issues with the default ItemsLayout default which is VerticalList).

I fixed this by upgrading my project to .net7, by going into csproj file in my project changing any reference to net6 with net7.

Hope it helps someone in the future!

huangapple
  • 本文由 发表于 2023年2月27日 18:28:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/75579282.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定