簡體   English   中英

適用於Android Xamarin渲染的Syncfusion SfAutoComplete在Hyper V Emulator上幾乎不可見

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

我已經成功使用了Xamarin Forms,但是我決定嘗試Syncfusion,但是我無法讓SfAutoComplete組件(或其他任何組件)正確顯示,如果可以看到,按照屏幕截圖顯示,非常小! 我已經按照文檔添加了Android和PCL參考,並顯示了我的PCL示例代碼。 我還創建了一個新項目,以確保添加的任何渲染都不是原因。 我很茫然!

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的屏幕截圖

這很愚蠢,文本很小,無法閱讀。 我使用了TextSize =“ 40”,一切都很好。 C#的完整性

countryAutoComplete.TextSize = 40;

您已直接在內容頁面內部添加了“自動完成”功能,因此它以全屏顯示為其尺寸。 這是控件渲染不正確的原因。在布局/網格中的任何一個中添加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;

    }
}

AutoComplete的TextSize屬性效果很好。 在這里,我附加了TextSize為20時另一個文本大小為40時AutoComplete的屏幕截圖。

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

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM