[英]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;
}
}
}
这很愚蠢,文本很小,无法阅读。 我使用了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;
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.