xamarin.android

MvvmCross Popup Window

穿精又带淫゛_ 提交于 2019-12-13 21:14:11
问题 I would like to have a popup window. Even though I am using MvvmCross, it will strictly run on Android. In Windows Store, you can do the following with xaml: <Popup VerticalOffset="300" HorizontalOffset="200" x:Name="SigPopup" > <Border BorderBrush="{StaticResource ApplicationForegroundThemeBrush}" Background="{StaticResource ApplicationPageBackgroundThemeBrush}" BorderThickness="1"> <StackPanel> <StackPanel Orientation="Horizontal" > <Button x:Name="btnAccept" Content="Accept" Click=

Xamarin Forms Android AppCompatActivity Toolbar background color is not changing

左心房为你撑大大i 提交于 2019-12-13 20:43:31
问题 In my Xamarin Forms Android Project I need to change the ToolBar Title color and background color I have tried with many workarounds suggested in Google but unfortunately I am unable to find the correct solution to me What I Need is What I am getting Now is by using below codes MainActivity.cs [Activity(Label = "Sample.Droid", Icon = "@mipmap/icon_launcher", Theme = "@style/MyTheme")] public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity { protected

Navigating to Tabbed Page

喜夏-厌秋 提交于 2019-12-13 20:26:59
问题 I have a ContentPage(Login Page) that should navigate to my TabbedPage(TabPage). The problem is when I use the code: await Application.Current.MainPage.Navigation.PushModalAsync(new TabbedPage()); to navigate to my tab page is not displaying anything. This is what I am seeing when I use the code above: And this is what I am seeing when I set the Main Page: 回答1: The Reason it is not working is that you are using the Xamarin.Forms.TabbedPage in place of your own TabbedPage Changing that should

ISharedPreferences stored string is updating after restart of my APP

半腔热情 提交于 2019-12-13 20:23:45
问题 I am passing a string from an Activity to Fragment everything works perfectly but my passed string is not updating instantly it updates after restart of my app.Through google search I tried changing my code "editor.commit" to "editor.apply" but no use please help me with your suggestions, thanks Activity.cs var text = newSentence.ToString(); ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(this); ISharedPreferencesEditor editor = prefs.Edit(); editor.PutString("Data",

Avoiding a NullReferenceException when creating a custom Android UI element from subclassed TextView

与世无争的帅哥 提交于 2019-12-13 19:17:15
问题 A couple of firsts here - first Android app and first time using MonoDroid (I've got lots of experience with C# .NET). In my user interface I want to draw a border around a TextView and found a post on SO (2026873) that recommended subclassing TextView. I also found another post (2695646) with some additional info on declaring a custom Android UI element using XML. (Note: All code in the example posts were in Java, had to translate into the C#/MonoDroid environment.) When I run the code in

Convert 'Xamarin.Form.Image' type 'byte[]'

百般思念 提交于 2019-12-13 18:45:42
问题 I am supposed to get an Image from a url and convert it into byte[] . The following is what I achieved var webImage = new Image { Aspect = Aspect.AspectFit }; webImage.Source = ImageSource.FromUri(new Uri("http://xamarin.com/content/images/pages/forms/example-app.png")); but now I am unable to convert the Image type to byte[] . Is this the correct way to approach? Any kind of help would be appreciated. 回答1: I haven't tried this but from my initial thought you will need a Stream. For that you

SearchView to your ActionBar for Recyclerview in xamarin android?

↘锁芯ラ 提交于 2019-12-13 17:26:02
问题 How To Implement SearchView to your ActionBar Search menu icon for Recyclerview listitem in xamarin android? 回答1: I wrote up a simple demo about how to implement this feature, effect like this. You can see it in this GitHub Repository. Setting up the SearchView In the folder res/menu create a new file called main.xml . In it add an item and set the actionViewClass to android.support.v7.widget.SearchView . Since you are using the support library you have to use the namespace of the support

Why is Resource.Designer.cs not created

橙三吉。 提交于 2019-12-13 17:24:55
问题 I created a class library (Mono for Android) and put the folders Resources/Drawable, Resources/Layout and Resources/Values in it. Unfortunately the file Resource.Designer.cs is not created automatically. I've all xml-Files set on BuildAction "AndroidResource"... but no recource file is created. DO I have to do something else? Thanks a lot! 回答1: There isn't support for resources in a class library project. Resources must be in the main application project. 来源: https://stackoverflow.com

How to access tap or click of an toolbar image in android xamarin forms

有些话、适合烂在心里 提交于 2019-12-13 17:07:42
问题 I have placed an image inside toolbar like in the below code. I did this to have an toolbar icon on the left side. <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/colorPrimary" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" android:popupTheme="@style/ThemeOverlay.AppCompat

Xamarin Android | Layout style

廉价感情. 提交于 2019-12-13 16:50:31
问题 I am trying to create this layout style but still I have no idea how to do it? is there anybody who can help me ? I need main layout and in the layout must be on the left image view for color next will be Title with description for fill parrent and on the right side must be img. 回答1: Here you go. I designed you left flag, title and description labels plus right image view control. Just create new .axml file and use this code: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns