[英]Android app launch
我開始為Android編程。 決定在Xamarin上的C#上編寫應用程序。 我有完整設計的axml。 在MainActivity中,我有以下內容:
ImageButton logoButton = FindViewById<ImageButton>(Resource.Id.logoButton);
ImageButton cartButton = FindViewById<ImageButton>(Resource.Id.cartButton);
ImageButton privateButton = FindViewById<ImageButton>(Resource.Id.privateButton);
ImageButton homeButton = FindViewById<ImageButton>(Resource.Id.homeButton);
ImageButton nextButton = FindViewById<ImageButton>(Resource.Id.nextButton);
ImageButton previousButton = FindViewById<ImageButton>(Resource.Id.previousButton);
此代碼-引用我在axml中的控件?
是。 現在,您可以更改按鈕的文本:
cartbutton.setText("...")
或設置一個按鈕監聽器:
cartbutton.setOnClickListener(new OnClicklistener(..){
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.