我有一个关于如何更改标题字体的类似问题:
现在我改变了有没有人知道如何更改顶部后退箭头的字体大小和重量以及导航页面顶部的消息?似乎这些不是标题的一部分,因为它们保留了原始字体大小和重量.
我在使用Xamarin更新UI时遇到困难。目的是制作响应式UI,以便用户知道应用程序正在思考。以下是我的尝试。
尝试1
private void BeginProcess(string fileName)
{
Device.BeginInvokeOnMainThread(() => {
iContent.Text = "UI Successfully updated.";
});
Device.BeginInvokeOnMainThread(() => {
ProccessFolder testMethod = new ProccessFolder.Initialize(fileName);
});
}
Run Code Online (Sandbox Code Playgroud)
尝试2
private void UpdateUI () {
iContent.Text = "UI Successfully updated.";
}
private void BeginProcess(string fileName)
{
System.Threading.Thread t = new System.Threading.Thread(UpdateUI);
t.Priority = System.Threading.ThreadPriority.Highest;
t.IsBackground = false;
t.Start();
Device.BeginInvokeOnMainThread(() => {
ProccessFolder testMethod = new ProccessFolder.Initialize(fileName);
});
}
Run Code Online (Sandbox Code Playgroud)
尝试3
private void BeginProcess(string fileName)
{
Device.BeginInvokeOnMainThread(() => {
iContent.Text = "UI Successfully updated.";
}); …Run Code Online (Sandbox Code Playgroud) 我有一个应用程序(Xamarin.IOS),它以一个没有TabBar的UIViewController(连接视图)开头.但是当用户登录时,我想将我创建的标签栏添加到其他视图中.反之亦然,当用户退出时,我想显示没有TabBar的连接视图.
我知道当我想在appDelegate中显示TabBar时,我必须像这样初始化_window:
_tabController = new TabController();
_window.RootViewController = _tabController;
_window.MakeKeyAndVisible();
Run Code Online (Sandbox Code Playgroud)
如果我想要一个没有TabBar的视图,这里是appDelegate:
viewController = new ConnectionViewController();
_window.RootViewController = new UINavigationController(viewController);
_window.MakeKeyAndVisible();
Run Code Online (Sandbox Code Playgroud)
使用此TabController:
public class TabController : UITabBarController
{
UIViewController tab1, tab2, tab3, tab4;
public TabController()
{
tab1 = new UINavigationController(new ListViewController());
tab1.Title = Texts.Home;
tab1.TabBarItem.Image = UIImage.FromFile("Icons/Home@2x.png");
tab2 = new UINavigationController(new OViewController(1));
tab2.Title = Texts.Categories;
tab2.TabBarItem.Image = UIImage.FromFile("Icons/Tag@2x.png");
tab3 = new UINavigationController(new SearchViewController());
tab3.Title = Texts.Search;
tab3.TabBarItem.Image = UIImage.FromFile("Icons/Search@2x.png");
tab4 = new UINavigationController(new BookmarkViewController(1));
tab4.Title = Texts.Bookmarks;
tab4.TabBarItem.Image = UIImage.FromFile("Icons/Favorite@2x.png");
var …Run Code Online (Sandbox Code Playgroud) tabbar uiviewcontroller uinavigationcontroller xamarin.ios ios
I have this code:
<Label x:Name="questionGroupHintInfoLabel" FontAttributes="Bold" Text="Folgende Hinweismeldung wurde für die aktuelle Fragengruppe hinterlegt:">
<Label.FontSize>
<OnPlatform x:TypeArguments="NamedSize"
iOS="Small"
Android="Small" />
</Label.FontSize>
</Label>
Run Code Online (Sandbox Code Playgroud)
...and get this error:
No property, bindable property, or event found for FontSize
Run Code Online (Sandbox Code Playgroud)
What i'm doing wrong?
Thanks.
我有一个显示单词的内容页面.我从数据库中获取单词,填充视图模型,然后通过绑定更改标签文本,然后此代码使新单词可见:
phrasesPageStackLayout.IsVisible = true;
Run Code Online (Sandbox Code Playgroud)
几秒钟后,这个词会消失:
phrasesPageStackLayout.IsVisible = false;
Run Code Online (Sandbox Code Playgroud)
我得到一个新词,然后又重新开始.
在Xamarin.Forms中,我可能会将单词淡入视图并淡出视图.例如,在3秒的时间内?
我WebView在Xamarin中有一个,我只需要可视化一个修复页面。我设置了一个页面,但是如果从Web视图中选择一个链接,它就会更改。我发现了该事件Navigating,如何在开始加载页面之前停止该页面?
.Xaml
<WebView x:Name="Browser"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand"
Navigating="webOnNavigating" />
Run Code Online (Sandbox Code Playgroud)
C#
void webOnNavigating(object sender, WebNavigatingEventArgs e)
{
}
Run Code Online (Sandbox Code Playgroud) 我正在Xamarin.Ios中使用UISearchController,并且一切正常,但是当我开始键入内容时,未覆盖SearchhResultUpdating方法不会触发。它有时可以正常运行,而其他时候则无法进行监听,但是现在根本不起作用。
这是SearchResultsUpdating类:
class SearchResult : UISearchResultsUpdating
{
public event Action<string> UpdateSearchResults = delegate { };
public override void UpdateSearchResultsForSearchController(UISearchController searchController)
{
this.UpdateSearchResults(searchController.SearchBar.Text);
}
}
Run Code Online (Sandbox Code Playgroud)
这是我使用它的时间:
var searchresult = new SearchResult();
searchresult.UpdateSearchResults += searchResultsController.Search;
var searchController = new UISearchController(searchResultsController) { SearchResultsUpdater = searchresult };
Run Code Online (Sandbox Code Playgroud)