简体   繁体   English

适用于Android Xamarin渲染的Syncfusion SfAutoComplete在Hyper V Emulator上几乎不可见

[英]Syncfusion SfAutoComplete for Android Xamarin rendering is nearly invisible on Hyper V Emulator

I am successfully using Xamarin Forms, however I decided to try Syncfusion but I cannot get the SfAutoComplete component (or probably any other) to show correctly, very very tiny rendering as per the screenshot, if you can see it! 我已经成功使用了Xamarin Forms,但是我决定尝试Syncfusion,但是我无法让SfAutoComplete组件(或其他任何组件)正确显示,如果可以看到,按照屏幕截图显示,非常小! I have added the Android and PCL references as per the docs and my PCL sample code is shown. 我已经按照文档添加了Android和PCL参考,并显示了我的PCL示例代码。 I also created a new project to ensure any rendering I added was not the cause. 我还创建了一个新项目,以确保添加的任何渲染都不是原因。 I am at a loss! 我很茫然!

using Syncfusion.SfAutoComplete.XForms;
using System;
using System.Collections.Generic;
using Xamarin.Forms;

namespace Greetings
{
    public partial class Page1 : ContentPage
    {
        public Page1()
        {
            InitializeComponent();
            ShowPage();
        }

        public void ShowPage()
        {
            SfAutoComplete countryAutoComplete = new SfAutoComplete();
            List<String> countryName = new List<String>();
            countryName.Add("Uganda");
            countryName.Add("Ukraine");
            countryName.Add("United Arab Emirates");
            countryName.Add("United Kingdom");
            countryName.Add("United States");
            countryAutoComplete.AutoCompleteSource = countryName;
            this.Content = countryAutoComplete;

        }
    }
}

使用Hyper V Emulator的屏幕截图

This is silly, the text is so small it cannot be read. 这很愚蠢,文本很小,无法阅读。 I used TextSize="40" and all is well. 我使用了TextSize =“ 40”,一切都很好。 C# for completeness C#的完整性

countryAutoComplete.TextSize = 40; countryAutoComplete.TextSize = 40;

You have added AutoComplete directly inside content page so that it takes full screen as its size. 您已直接在内容页面内部添加了“自动完成”功能,因此它以全屏显示为其尺寸。 This is the reason for improper control rendering.Add countryAutoComplete in anyone of the layout/grid and try to set TextSize for countryAutoComplete. 这是控件渲染不正确的原因。在布局/网格中的任何一个中添加countryAutoComplete并尝试为countryAutoComplete设置TextSize。

public partial class Page1 : ContentPage
{
    public Page1()
    {
        InitializeComponent();
        ShowPage();
    }
    public void ShowPage()
    {
        SfAutoComplete countryAutoComplete = new SfAutoComplete();
        List<string> countryName = new List<string>();
        countryName.Add("Uganda");
        countryName.Add("Ukraine");
        countryName.Add("United Arab Emirates");
        countryName.Add("United Kingdom");
        countryName.Add("United States");
        countryAutoComplete.AutoCompleteSource = countryName;
        countryAutoComplete.TextSize = 20;
        StackLayout stack = new StackLayout();
        stack.Padding = new Thickness(50,100,50,100);
        stack.Children.Add(countryAutoComplete);
        this.Content = stack;

    }
}

The TextSize property of AutoComplete is works well. AutoComplete的TextSize属性效果很好。 Here I have attached the screenshots of AutoComplete when TextSize is 20 in another one TextSize is 40. 在这里,我附加了TextSize为20时另一个文本大小为40时AutoComplete的屏幕截图。

TextSize is 20 - https://i.stack.imgur.com/euNIg.png TextSize为20- https: //i.stack.imgur.com/euNIg.png

TextSize is 40 - https://i.stack.imgur.com/zPbl9.png TextSize为40- https: //i.stack.imgur.com/zPbl9.png

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM