小编Joy*_*nna的帖子

xamarin.forms中的DefaultRenderer错误(Android)

我正在使用xamarin表单...有时当我尝试回到我的上一页时,我看到了这个(Android设备):

System.NotSupportedException:无法从本机句柄0xbeb4a30c激活Xamarin.Forms.Platform.Android.Platform + DefaultRenderer类型的实例

我在标签渲染器和框渲染器中看到了同样的问题,但我解决了在自定义渲染器中创建构造函数的问题,因为下链接建议:

MonoDroid:调用自定义视图的构造函数时出错 - TwoDScrollView

但是没有关于DefaultRenderer错误的信息,就像我过去30天搜索过的所有内容一样......我疯了......

完全例外:

System.NotSupportedException:无法从本机句柄0xbecdf3ac(key_handle 0x24da7695)激活Xamarin.Forms.Platform.Android.Platform + DefaultRenderer类型的实例.

04-04 11:51:53.914 D/Mono(30832):DllImport尝试加载:'/ system/lib/liblog.so'.04-04 11:51:53.914 D/Mono(30832):DllImport加载库'/system/lib/liblog.so'.04-04 11:51:53.914 D/Mono(30832):DllImport搜索:'/ system/lib/liblog.so'('/ system/lib/liblog.so').04-04 11:51:53.914 D/Mono(30832):搜索'__android_log_print'.04-04 11:51:53.914 D/Mono(30832):探测'__android_log_print'.04-04 11:51:53.914 D/Mono(30832):找到'__android_log_print'.04-04 11:51:53.924 I/MonoDroid(30832):UNHANDLED EXCEPTION:04-04 11:51:53.944 I/MonoDroid(30832):System.NotSupportedException:无法激活Xamarin.Forms.Platform.Android类型的实例.Platform + DefaultRenderer来自本机句柄0xbecdf3ac(key_handle 0x24da7695).---> System.MissingMethodException:找不到Xamarin.Forms.Platform.Android.Platform + DefaultRenderer ::.ctor(System.IntPtr,Android.Runtime.JniHandleOwnership)---> Java.Interop.JavaLocationException的异常:类型'Java.Interop.JavaLocationException'被抛出.04-04 11:51:53.944 I/MonoDroid(30832):---内部异常堆栈跟踪结束--- 04-04 11:51:53.944 I/MonoDroid(30832):at Java.Interop.TypeManager.CreateProxy (System.Type类型,System.IntPtr句柄,Android.Runtime.JniHandleOwnership传输)[0x00054] in:0 04-04 11:51:53.944 I/MonoDroid(30832):at Java.Interop.TypeManager.CreateInstance(System. IntPtr句柄,Android.Runtime.JniHandleOwnership transfer,System.Type targetType)[0x00111] in:0 04-04 11:51:53.944 I/MonoDroid(30832):---内部异常堆栈跟踪结束--- 04- 04 11:51:53.944 I/MonoDroid(30832):at Java.Interop.TypeManager.CreateInstance(System.IntPtr handle,Android.Runtime.JniHandleOwnership transfer,System.Type targetType)[0x0017d] in:0 04-04 11: 51:53.944 I/MonoDroid(30832):在Java.Lang.Object.GetObject(System.IntPtr句柄,Android.Runtime.JniHandleOwnership transfer,System.Type类型)[0x000b9]中:0 04-04 11:51:53.944 I/MonoDroid(30832):在Java.Lang.Object._GetObject [T](System.IntPtr句柄,Android.Runtime.JniHandleOwnership …

mobile android renderer xamarin.forms

22
推荐指数
1
解决办法
625
查看次数

找不到Xamarin.Forms.Platform.Android.LabelRenderer(xamarin表单)的构造函数

当我在我的samsumg galaxy s5设备中测试我的应用程序时,我在pcl项目的xaml中有一个图像列表我这样做:我进入列表的页面,然后我按下操作栏上的后退按钮...我做了很多次......然后,它发生了:

System.NotSupportedException:无法从本机句柄0x20e0001d(key_handle 0x42433c30)激活Xamarin.Forms.Platform.Android.Platform + DefaultRenderer类型的实例.

要么

无法从本机激活Xamarin.Forms.Platform.Android.LabelRenderer类型的实例


更新

我添加了这个脚本:

using System;
using Android.Runtime;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;

[assembly: ExportRenderer(typeof(Xamarin.Forms.Label), typeof(LabelRenderer))]
namespace neoFly_Montana.Droid
{
/// <summary>
/// This renderer was added to resolve a bug that crashed the application in known case
/// Bug 36285 - Android App (Always) Crashes After Navigating Away From Page With A ScrollView In HeaderTemplate of ListView
/// <seealso cref="https://bugzilla.xamarin.com/show_bug.cgi?id=36285"/>
/// and 
/// Bug 32462 - Crash after a page disappeared if a ScrollView …
Run Code Online (Sandbox Code Playgroud)

c# xaml xamarin.android xamarin xamarin.forms

12
推荐指数
1
解决办法
600
查看次数

在xamarin形式的其他图像之上的图像的一半

我正在使用xamarin表单我需要创建一个布局,其中两个对象的位置如下:

在此输入图像描述

另一个(正方形)上方一半(圆圈)的一半

我已经搜索过,似乎我需要使用相对布局...我试图将两个对象设置在同一个网格中(行和行0),然后使用constraintX在同一个Y中设置第二个因子0和负常数......但它没有用.a删除了这些行并且不能在这里显示,不幸的是......在这里发生的唯一事情是:两者在y中处于相同的位置,但我可以像上面的图像那样...有人可以帮我吗举个例子,想法还是其他什么?非常感谢你!

我的代码现在 - rodape图像是方形,重新加载是圆圈我现在事实上重新加载在广场下是错误的,但是,现在,它假装视觉......它给了我一个结果关闭我想要......但不完全是这样

<!--Rodapé Grid-->
<RelativeLayout HorizontalOptions="FillAndExpand" 
                VerticalOptions="EndAndExpand" 
                BackgroundColor="Black">
    <Grid BackgroundColor="Red"
           RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent,
                                                                 Property=Width,
                                                                 Factor=1,
                                                                 Constant=0}">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Image Source="rodape.png" 
               Aspect="Fill"
               HorizontalOptions="FillAndExpand"
               Grid.Row="0"
               Grid.Column="0">
            <Image.GestureRecognizers>
                <TapGestureRecognizer Tapped="FranqueadoOnTapGestureRecognizerTapped"/>
            </Image.GestureRecognizers>
        </Image>
        <!--Escrito Rodapé-->
        <StackLayout Orientation="Vertical"
                     VerticalOptions="End"
                     HorizontalOptions="FillAndExpand"
                     Grid.Row="0"
                     Spacing="0"
                     Grid.Column="0">
            <Image Source="reloadicon.png"/>
            <StackLayout Orientation="Horizontal" 
                         HorizontalOptions="Center">
                <local:MyLabel NamedFontSize="Medium" 
                               FontSizeFactor="0.7" 
                               Text="Seja um Franqueado:"
                               TextColor="White"
                               FontAttributes="Bold"
                               Style="{StaticResource labelsfont}"/>
                <local:MyLabel NamedFontSize="Medium" 
                               FontSizeFactor="0.7" Text="montanaexpress.com"
                               Style="{StaticResource labelsfont}"
                               TextColor="{StaticResource laranjacolor}"/>              
            </StackLayout>
        </StackLayout>
    </Grid>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

layout xaml xamarin.forms

11
推荐指数
1
解决办法
1015
查看次数

缓存图像(ffimageloading)与Android上的OUT OF MEMORY错误 - xamarin表单

我在ffimageloading中有一些图像列表视图:CachedImage库....但是...当我测试时我正在反复做:我打开列表视图并按下操作栏上的后退按钮,在确定的时间,我按后退按钮我有一个例外:

03-02 09:31:13.511 I/art(2430):启动阻止GC显式03-02 09:31:13.522 I/art(2430):将目标GC堆从108MB钳制到96MB 03-02 09:31: 13.522 I/art(2430):显式并发标记扫描GC释放10820(745KB)AllocSpace对象,90(1956KB)LOS对象,3%免费,92MB/96MB,暂停136us总计9.552ms 03-02 09:31:13.535 D/Mono(2430):GC_OLD_BRIDGE num-objects 997 num_hash_entries 50753 sccs size 25365 init 0.00ms df1 37.29ms sort 7.73ms dfs2 26.26ms setup-cb 1.58ms free-data 17.62ms links 67211/67211/24685/2 dfs pass 118961/92576 03-02 09:31:13.535 D/Mono(2430):GC_BRIDGE:完成,运行79.60ms 03-02 09:31:13.535 D/Mono(2430):GC_MAJOR_SWEEP:主要尺寸:9136K使用中:8634K 03-02 09:31:13.535 D/Mono(2430):GC_MAJOR :( LOS溢出)时间60.53ms,stw 67.10ms los size:27648K正在使用:8339K 03-02 09:31:13.578 I/art(2430):启动阻止GC Alloc 03-02 09:31:13.578 I/art(2430):启动阻止GC Alloc 03-02 09: 31:13.580 I/art(2430):启动阻止GC Alloc 03-02 09:31:13.585 I/art(2430):将目标GC堆从108MB夹紧到96MB 03-02 09:31:13.585 I/art( 2430):Alloc部分并发标记扫描GC释放4847(397KB)AllocSpace对象,0(0B)LOS对象,4%免费,92MB/96MB,暂停191us总计5.177ms 03-02 09:31:13.585 I/art(2430 ):启动阻塞GC Alloc 03-02 09:31:13.594 I/art(2430):钳制目标GC堆从108MB到96MB 03-02 …

listview exception xamarin.android xamarin xamarin.forms

7
推荐指数
1
解决办法
653
查看次数

Rg.Plugins.Popup仅在发布模式下不起作用(Xamarin.forms)

我正在使用Rg.Plugins.Popup并且它在调试模式下工作正常...但是当我尝试发布模式或者当我生成apk时它不起作用.有人看到过类似的东西吗?我猜其他插件也不存在

--------------更新----------------------

现在它在发布模式下工作没有任何理由,我不知道为什么......但在安装的apk中它不起作用

在此输入图像描述

android apk xamarin.forms

7
推荐指数
1
解决办法
222
查看次数

将 HttpResponseMessage 转换为对象

我有这个结构,我也在使用System.Net.HttpNewtonsoft。我需要接收 webservice 响应并在我的班级中转换它,但我不知道如何使用 HttpResponseMessage 来做到这一点,而且我红色的帖子对我没有帮助。这是一个 Xamarin.forms 项目。

 public static async Task<User> PostLoginAsync(string login, string senha)
    {
        using (var client = new HttpClient())
        {
            try
            {
                login = "email@hotmail.com";
                senha = "1111111";

                var content = new FormUrlEncodedContent(new[]
                    {
                        new KeyValuePair<string, string>("id", "1200"),
                        new KeyValuePair<string, string>("email", login),
                        new KeyValuePair<string, string>("password", senha),
                        new KeyValuePair<string, string>("json", "1"),
                     });

                HttpResponseMessage response = await client.PostAsync("http://ws.site.com", content);

                return null;
            }

            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                return null;
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

我的课:

class User …
Run Code Online (Sandbox Code Playgroud)

http xamarin xamarin.forms

5
推荐指数
1
解决办法
8773
查看次数

更改每个屏幕尺寸xamarin形式的标签大小

我正在使用xamarin.forms来做一个应用程序我觉得使用相同的大小来写信给ios设备是行不通的:在7加上它运行良好,但在iPhone 5上它是一个大字母的屏幕大小...有人知道如何使用可伸缩大小的字母,或更改特定设备或屏幕大小类型的大小?非常感谢你.

c# layout xaml xamarin xamarin.forms

5
推荐指数
1
解决办法
3506
查看次数

以xamarin形式的字体大小

我正在使用xamarin表单并面临布局问题.现在,使用fontsize ..我有两个标签,其中一个是Micro.我需要另一个得到Micro标签/ 2的大小作为它的大小...我正在阅读相关布局,但我不知道这是否是最好的方式...有人有任何想法帮我?这是我的标签:

   <StackLayout Spacing="0">
        <Label x:Name="menu_lbl_promocoes" Text="0000" FontAttributes="Bold" TextColor="Black" HorizontalOptions="Center" Style="{Binding labelsfont}"/>
        <Label x:Name="menu_lbl_disponiveis" Text="Disponíveis" TextColor="Black" HorizontalOptions="Center" FontSize="Small" Style="{Binding labelsfont}"/>
   </StackLayout>

       </StackLayout> //yeah, there is another stacklayout 

       <Label Text="Promoções" FontSize="Micro" TextColor="White" HorizontalOptions="Center" Style="{Binding labelsfont}"/>
Run Code Online (Sandbox Code Playgroud)

我需要第二个标签获得第三个标签的半尺寸(具有微尺寸)...

layout xaml label xamarin xamarin.forms

4
推荐指数
1
解决办法
8408
查看次数

在哪里可以找到 xamarin ios 设备日志?

我正在使用 xamarin 表单,但收到此错误

严重性代码描述项目文件行抑制状态错误错误MT1006:无法安装应用程序'/Users/thiagofmartins/Library/Caches/Xamarin/mtbs/builds/neoFly_Montana.iOS/b6e2debf676f3efdb9da75d6f5344ce4/bin/iPhone/Debug/neoFly_Montana.iOS.app ' 在设备“iPhone de THIAGO”上:您的代码签名/配置文件配置不正确。您的当前配置文件可能不支持您的权利,或者您的设备不是当前配置文件的一部分。请检查 iOS 设备日志以了解详细信息(错误:0xe8008016)。

它出现在我的 Windows 视觉工作室中,我正在使用 Mac 来在 Iphone 设备中启动我的应用程序。

我想,也许在 IOS 设备日志中我可以看到有关此错误的更多详细信息,但是,我在哪里可以找到它?仅在 Mac 中,或者我可以在 Windows Visual Studio 中看到?我需要将我的项目转移到 Mac 上才能看到吗?

xamarin.ios ios xamarin xamarin.forms

4
推荐指数
1
解决办法
5503
查看次数

当我清除应用程序数据时,它不再起作用

我正在使用xamarin表格做一个应用程序,我在我的手机上测试它,然后apk就在那里.但当我清除android上的数据时,我的应用程序不再打开了......有人看到了吗?问题是什么??

android ios xamarin xamarin.forms

3
推荐指数
1
解决办法
526
查看次数