简体   繁体   English

Google Chrome浏览器的Android浏览器中的翻译语言菜单控件的名称是什么,以及如何实现?

[英]What is the name of translate language menu control from Google Chrome's Android browser and how to implement it?

I noticed the menu on the bottom side of Google Chrome's Android web browser application. 我注意到Google Chrome浏览器的Android网络浏览器应用程序底部的菜单。 It is used for setting language for translation of pages. 用于设置页面翻译的语言。 Can you help me identify what is this control's name? 您能帮我确定此控件的名称是什么吗?

在此处输入图片说明

I'm currently working on Xamarin.Forms project and would like to implement similar menu on the bottom side of my screen for all Android devices. 我目前正在研究Xamarin.Forms项目,并希望在屏幕底部为所有Android设备实现类似的菜单。 Is that possible in Xamarin.Forms and how would the implementation look like? 这在Xamarin.Forms中是可能的,实现看起来如何?

I'm currently working on Xamarin.Forms project and would like to implement similar menu on the bottom side of my screen for all Android devices. 我目前正在研究Xamarin.Forms项目,并希望在屏幕底部为所有Android设备实现类似的菜单。 Is that possible in Xamarin.Forms and how would the implementation look like? 这在Xamarin.Forms中是可能的,实现看起来如何?

There is no direct control in xamarin.forms that can serve this purpose. xamarin.forms中没有直接的控件可以满足此目的。 So you will need your own Custom View for this: 因此,您需要为此使用自己的自定义视图

  1. In PCL, create a custom control class( MyTabLayout ): 在PCL中,创建一个自定义控件类( MyTabLayout ):

     public class MyTabLayout:View { } 
  2. In PCL page, using this control in Xaml: 在PCL页面中,在Xaml中使用此控件:

     <StackLayout> <!--EndAndExpand will bottom the tab control--> <local:MyTabLayout VerticalOptions="EndAndExpand"></local:MyTabLayout> </StackLayout> 
  3. In YourProject.Android project Create your custom renderer: YourProject.Android项目中,创建您的自定义渲染器:

     [assembly:ExportRenderer(typeof(CustomTabsLayout.MyTabLayout), typeof(MyTabLayoutRenderer))] namespace CustomTabsLayout.Droid { public class MyTabLayoutRenderer:ViewRenderer<MyTabLayout,TabLayout> { Context baseContext; public MyTabLayoutRenderer(Context context) : base(context) { baseContext = context; } protected override void OnElementChanged(ElementChangedEventArgs<MyTabLayout> e) { base.OnElementChanged(e); //Below are test tabs, you can customize your tabs' styles here. TabLayout tab = new TabLayout(baseContext); tab.AddTab(tab.NewTab().SetText("tab1")); tab.AddTab(tab.NewTab().SetText("tab2")); tab.AddTab(tab.NewTab().SetText("tab3")); tab.AddTab(tab.NewTab().SetText("tab4")); tab.AddTab(tab.NewTab().SetText("tab5")); SetNativeControl(tab); } } } 

Here is the result: 结果如下:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 这个android菜单的名称是什么以及如何实现它 - What is the name of this android menu and how to implement it 如何将用户从Chrome Android浏览器转到Android网络共享菜单? - How to take users to Android Tethering menu from Chrome Android browser? 如何在Android中从一种语言翻译成另一种语言 - How to translate from one Language to Another In Android 如何在Android中翻译语言? - How to translate Language in android? 如何将文本从一种语言翻译成另一种语言 android? - How to translate text from one language to another language android? android中这个控件的名称是什么以及如何实现它? - What is the name of this controls in android and how to implement this? 名称是什么,以及如何在Android平板电脑中实现? - what is the name and how to implement it in android tablet? Android活动名称,如何将我所拥有的内容翻译成Intent调用 - Android activity name, how to translate what I have into an Intent call 如何在android中访问像chrome这样的第三方浏览器控件? - how to access the third party browser control like chrome in android? android中此控件的名称是什么? - What is the name of this control in android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM