我努力寻找解决方案,但无法找到解决方案。 这就是我希望实现的目标, Can you have a textSwitcher and imageSwitcher in the same class?
但我无法将其转换为C#代码。我对它给出的错误一无所知。
我知道我需要创建一个内部类。但我对如何感到困惑。
谢谢!
答案 0 :(得分:0)
使用您提供的链接,您的内部类在Xamarin
中看起来像这样public class TextSwitcherFactory : Java.Lang.Object, ViewSwitcher.IViewFactory
{
public View MakeView()
{
TextView t = new TextView(Latest.this);
t.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL);
t.setTextSize(36);
return t;
}
}