android - 是否可以在 iOS 和/或 Android 上通过 WebView 分层其他 Xamarin.Forms 控件?

标签 android ios webview xamarin.forms

我假设 iOS 和 Android 上的 Xamarin.Forms WebView 实现将针对每个平台使用“ native ”浏览器。

这是否允许其他 Xamarin.Forms 控件在顶部分层?

我不确定,因为我使用过其他工具包,这些工具包在每个平台上都使用“轻量级”控件,因此不能叠加在“重量级”控件上,但我也相信 Xamarin.Forms 在每个平台上使用所有 native 组件(因此可能使这成为可能)。

有人可以为我澄清一下吗?

谢谢!

最佳答案

是的,这是可能的,尽管出于显而易见的原因,覆盖 webview 控件的任何部分都不是一个好主意。

            <Grid> 
                <Grid.RowDefinitions>
                    <RowDefinition Height="9*"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>

                <WebView VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>

                <Image Aspect="AspectFit" Source="redball.png" HeightRequest="20" WidthRequest="20" 
                       VerticalOptions="StartAndExpand" HorizontalOptions="CenterAndExpand"/>

                <Frame x:Name="frmFooter" CornerRadius="0" Padding="0" HasShadow="False" Grid.Row="1"/>
            </Grid>

此示例将一个小的红球放在您的 WebView 控件的顶部中心。

希望对您有所帮助。

关于android - 是否可以在 iOS 和/或 Android 上通过 WebView 分层其他 Xamarin.Forms 控件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53664372/

相关文章:

android - Android Docx4J Gradle:尽管排除了类org.slf4j

android - 简单的脚本带回了无意义的错误

ios - Swift:Apple Mach-O 链接器 (id) 错误 - Xcode 8.3

iOS - 在滚动之前移动 TableView

iphone - iOS UIwebView 身份验证 Cookie

ios - Swift4 应用程序在加载本地 HTML 时崩溃

android - AVG 杀毒软件将我的 React Native Android 应用程序检测为恶意软件

android - 在android中的 Canvas 位图上单指缩放和旋转

ios - 打开设置应用程序

android - 如何将xml加载到webview android