Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all 204402 articles
Browse latest View live

ActionBar

$
0
0

Im having problems with getting an ActionBar working. Your sample Todo doesn't even work, eg, it doesn't show the add toolbar item.

So I want to get rid of it entirely. I can hide it on the mainactivity ok, but how does one hide it on other pages that are navigated to from the main page?


Adjust Width of Master on MasterDetailPage

$
0
0

I am using the MasterDetailPage for the NavigationDrawer on Android. Implementing the functionality has gone perfectly, however the width is too large and i would like to adjust it.

I have tried to set the WidthRequest for the ListView CellTemplate, ListView, and the Master Property of the MasterDetailPage all to the same value, and i can see that the cells are at the right width but the slide out part is still too big.

public MainPage(Action loginFaliedCallback)
{
MenuPage menu = new MenuPage { Title = "Menu", WidthRequest = 250 };
menu.Menu.ItemSelected += (s, e) => NavigateTo(e.SelectedItem as MenuItem);
Master = menu;
Master.WidthRequest = 250;
}

Any information would be greatly appreciated. Thanks in advance.

Android TitleBar "NoTitle" option

$
0
0

Hi everyone,

how can I hide the TitleBar in Android? I tried RequestWindowFeature(WindowFeatures.NoTitle) in my Android project of the Forms solution but get a NullPointerException on SetPage.

My main Page is a TabbedPage, but I'm not using ToolbarItems.

Why can't Xamarin detect my tablet?

$
0
0

I'm trying to debug my first app on my Android tablet.

I have made sure that USB debugging is checked.

I am running windows 7 and when I plugged in the tablet by USB, a popup said "searching for drivers....installing drivers....installation complete"

Then the auto-run popped up asking what I would like to do with my tablet which I just plugged in. So all seems good with Windows detecting my tablet.

However in Xamarin studio, which I have since restarted, when I click on: Run -> Run With : my android device is not there.

Any suggestions?

Latest parse.com working for push notifications

$
0
0

Could some please help me with trying to get parse.com to work with my ios project to allow me to send push notifications.

The component in the component store doesnt work for me. Due to something that looks similar to forums.xamarin.com/discussion/4672/could-not-register-the-selector I to get an error

Could not register the selector 'loadObjects:clear:' of the member 'ParseTouch.ParseQueryTableViewController.LoadObjectsclear' because the selector is already registered on the member 'LoadObjects'.

I have tried downloading the sdk and tried to add the Parse.iOS.dll to the project. Doing this I dont have the ParsePush namespace available meaning I can't add the StoreDeviceToken. I have hunted through all of the classes and I can't see a way to set the device properties using this dll

My next idea was to try create a binding using the sdk on parse.com. I followed these instructions pierceboggan.com/post/42810705640/push-notifications which gave me an error because the makefile reference was to an older zip folder for the sdk. I updated the makefile to point to the correct zip however when trying make it throws 42 errors complaining about ComponentModel does not exist in the namespace System.

Please can someone help out as I've been going around in circles trying to get this to work.

"java.exe" exited with code 1 when Binding Parse Java SDK to Xamarin.Android

$
0
0

Hello Guys,

I'm trying to bind the the Parse Android Java SDK to Xamarin.Android

I've followed this tutorial http://docs.xamarin.com/guides/android/advanced_topics/java_integration_overview/binding_a_java_library_(.jar)

I've added Parse_1.3.4.jar as an EmbeddedJar and android-support-v4.jar and Facebook_Android_SDK_v3.5.jar, as EmbeddedReferenceJar

I am using Visual Studio 2012, and when building the project I get 1 error ("java.exe" exited with code 1 ) and 12 warnings. The output is as follows:
1>------ Build started: Project: CompanyII.Blink.Mobile.Android.JLibrary, Configuration: Debug Any CPU ------
1>Build started 31/08/2013 17:22:14.
1>ResolveLibraryProjects:
1>Skipping target "ResolveLibraryProjects" because it has no inputs.
1>_ResolveMonoAndroidSdks:
1> MonoAndroid Tools: C:\Program Files (x86)\MSBuild\Xamarin\Android\
1> MonoAndroid Framework: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.2\;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\
1> Android SDK: C:\Users\Account\Android_Dev\sdk\
1> Java SDK: C:\Program Files\Java\jdk1.7.0_25\
1> Android Platform API level: 17
1> TargetFrameworkVersion: v4.2
1>ExportJarToXml:
1> Assemblies:
1> C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.2\Mono.Android.dll
1> C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll
1> C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll
1> Jars:
1> ResolvedResourceDirectories:
1> SourceJars:
1> Jars\Parse-1.3.4.jar
1> ReferenceJars:
1> Jars\Facebook_Android_SDK_v3.5.jar
1> Jars\android-support-v4.jar
1> C:\Program Files\Java\jdk1.7.0_25\bin\java.exe -jar "C:\Program Files (x86)\MSBuild\Xamarin\Android\jar2xml.jar" --jar=C:\Users\Account\CompanyII\Blink\CompanyII.Blink.Mobile\CompanyII.Blink.Mobile.Android.JLibrary\Jars\Parse-1.3.4.jar --ref=C:\Users\Account\Android_Dev\sdk\platforms\android-17\android.jar --out=C:\Users\Account\CompanyII\Blink\CompanyII.Blink.Mobile\CompanyII.Blink.Mobile.Android.JLibrary\obj\Debug\api.xml --ref=C:\Users\Account\CompanyII\Blink\CompanyII.Blink.Mobile\CompanyII.Blink.Mobile.Android.JLibrary\Jars\Facebook_Android_SDK_v3.5.jar --ref=C:\Users\Account\CompanyII\Blink\CompanyII.Blink.Mobile\CompanyII.Blink.Mobile.Android.JLibrary\Jars\android-support-v4.jar
1> Exception in thread "main" java.lang.InternalError: Enclosing method not found
1> at java.lang.Class.getEnclosingMethod(Class.java:952)
1> at sun.reflect.generics.scope.ClassScope.computeEnclosingScope(ClassScope.java:50)
1> at sun.reflect.generics.scope.AbstractScope.getEnclosingScope(AbstractScope.java:74)
1> at sun.reflect.generics.scope.AbstractScope.lookup(AbstractScope.java:90)
1> at sun.reflect.generics.factory.CoreReflectionFactory.findTypeVariable(CoreReflectionFactory.java:110)
1> at sun.reflect.generics.visitor.Reifier.visitTypeVariableSignature(Reifier.java:165)
1> at sun.reflect.generics.tree.TypeVariableSignature.accept(TypeVariableSignature.java:43)
1> at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68)
1> at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138)
1> at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
1> at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68)
1> at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138)
1> at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
1> at sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:100)
1> at java.lang.Class.getGenericInterfaces(Class.java:814)
1> at jar2xml.JavaClass.getGenericInterfaces(JavaClass.java:212)
1> at jar2xml.JavaClass.doAppendToDocument(JavaClass.java:593)
1> at jar2xml.JavaClass.appendToDocument(JavaClass.java:544)
1> at jar2xml.JavaPackage.appendToDocument(JavaPackage.java:72)
1> at jar2xml.Start.main(Start.java:119)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Bindings.targets(245,5): error MSB6006: "java.exe" exited with code 1.
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.17
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Default constructor not found for type Microsoft.WindowsAzure.MobileServices.CurrentPlatform

$
0
0

As per http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-push-xamarin-ios/ I have implemented some stock standard code in my Xamarin iOS project for using Azure Mobile Services for push notifications:

public static MobileServiceClient MobileService = new MobileServiceClient(
"https://[appurl].azure-mobile.net/",
"[appkey]");

However when the the app starts up (the above property is on AppDelegate) it fails with:

System.TypeInitializationException: An exception was thrown by the type initializer for JG.AppDelegate ---> System.Exception: Default constructor not found for type Microsoft.WindowsAzure.MobileServices.CurrentPlatform
at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00094] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:326
at System.Activator.CreateInstance (System.Type type) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:222
at Microsoft.WindowsAzure.MobileServices.Platform.get_Instance () [0x00054] in c:\code\azure-mobile-services\sdk\Managed\src\Microsoft.WindowsAzure.MobileServices\Platform\Platform.cs:64
at Microsoft.WindowsAzure.MobileServices.MobileServiceClient.GetApplicationInstallationId () [0x00004] in c:\code\azure-mobile-services\sdk\Managed\src\Microsoft.WindowsAzure.MobileServices\MobileServiceClient.cs:582
at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor (System.Uri applicationUri, System.String applicationKey, System.Net.Http.HttpMessageHandler[] handlers) [0x00028] in c:\code\azure-mobile-services\sdk\Managed\src\Microsoft.WindowsAzure.MobileServices\MobileServiceClient.cs:195
at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor (System.Uri applicationUri, System.String applicationKey) [0x00000] in c:\code\azure-mobile-services\sdk\Managed\src\Microsoft.WindowsAzure.MobileServices\MobileServiceClient.cs:149
at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor (System.String applicationUrl, System.String applicationKey) [0x00000] in c:\code\azure-mobile-services\sdk\Managed\src\Microsoft.WindowsAzure.MobileServices\MobileServiceClient.cs:134
at JG.AppDelegate..cctor () [0x00000] in /Users/markgibaud/Projects/JG.Mobile/JG/AppDelegate.cs:23
--- End of inner exception stack trace ---
at at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/.pp-UIApplication.cs:38
at JG.Application.Main (System.String[] args) [0x00008] in /Users/markgibaud/Projects/JG.Mobile/JG/Main.cs:12

I have removed and re-added the Windows Azure Mobile component, with no luck.

What should I try next?

Using:
-Latest stable Xamarin.iOS
-Xamarin Studio

VS.android and iOS should be FREE

$
0
0

So here I am, new to Xamarin, trying to check things out, run a simple cross plat hello-world starter project with WP8, WinRT, Android and iOS in the solution. BAM, no can do. Must buy Business edition for $999 just to do this.

This makes no sense. At all.

Xamarin, please take a lesson from Unity3d. Their free tools are free, until your company makes over $x or your team is x in size. The fact that I cannot even open a simple solution in VS without putting down a grand is a bootstraped startup killer.

Lets look even deeper at the business case here: dev gets to put (cross plat, droid, iOS, the works) projects together for free - Xamarin makes no $.

-Dev startup fails - Xamarin makes no money. OR,

-Dev startup succeeds, Xamarin now makes $$$ (not only from dev, but now his whole team). OR,

-Dev was a hobbyist, Xamarin makes no $. BUT, dev is now experienced with Xamarin, has a job at some enterprise corp trying to build cross plat apps, and succeeds in influencing the whole team that Xamarin is the shiz. Xamarin now makes $$$ on the entire team.

It is a win no matter what. Upsides all around, for Xamarin and Dev. But as it stands right now, you are crippling both the Dev and yourself by improper skew/pricing schemes. I have not evaluated yet, but also suspect your app size restriction is too limited as well.

Please call me. I have a lot of experience with this stuff (former product manager of Expression Studio and Visual Studio at Microsoft).


CarouselPage or TabbedPage within a Page (or actually, within a Grid.Row)

$
0
0

In many weather apps (at least on WP), it's quite common to use a static page header in page where the header is in Grid.Row="0" and a Carousel (Panorama in WP [Pivot/TabbedPage are also used]) in Grid.Row="1". Using this concept, the following would be a generic example of a page structure without the carousel:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Test.Xaml.MainView">
<Grid x:Name="LayoutRoot" BackgroundColor="Red">
<Grid.RowDefinitions>
<RowDefinition Height="80" />
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid x:Name="PageHeader" Grid.Row="0" BackgroundColor="Green">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<!--FYI, have to put two columns here for the grid.row="0" to stretch across page-->
</Grid.ColumnDefinitions>
<Label Text="this is the title" TextColor="Yellow" Grid.Column="1"/>
</Grid>
<Label x:Name="PageBody" Text="this is the body" Grid.Row="1"/>
</Grid>
</ContentPage>

And here is an example of using a CarouselPage within Grid.Row="1" that doesn't work:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Test.Xaml.MainView">
<Grid x:Name="LayoutRoot" BackgroundColor="Red">
<Grid.RowDefinitions>
<RowDefinition Height="80" />
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid x:Name="PageHeader" Grid.Row="0" BackgroundColor="Green">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<!--FYI, have to put two columns here for the grid.row="0" to stretch across page-->
</Grid.ColumnDefinitions>
<Label Text="this is the title" TextColor="Yellow" Grid.Column="1"/>
</Grid>
<CarouselPage x:Name="PageBody" Grid.Row="1">
<CarouselPage.Children>
<ContentPage Title="ThePageOne">
<Label Text="Page 1" VerticalOptions="Center" TextColor="#FFFFFFFF"/>
</ContentPage>
<ContentPage Title="ThePageTwo">
<Label Text="Page 2" VerticalOptions="Center" TextColor="#FFFFFFFF"/>
</ContentPage>
</CarouselPage.Children>
</CarouselPage>
</Grid>
</ContentPage>

The Label in Grid.Row="1" was just simply replaced by a CarouselPage. This kicks the error Parent of a Page must also be a Page.

So the questions are:
1. Is there anyway to achieve the following layout desired above (e.g. a CarouselPage or TabbedPage as a part of a page that has other layout elements, such as a page header)?
2. If not, how would I go about requesting new controls in a future release, like CarouselView or TabbedView?

F# TShirt Store App - Packaging Error

$
0
0

Im receiving the following error when the app is packaged:

AndroidManifest.xml(0,0): Error: No resource found that matches the given name (at 'theme' with value '@style/Mono.Android.Theme.Splash'). (XamarinStore.Droid)

I'm very new to Xamarin Studio so I'm probably doing something wrong. I did find some other similar posts which said the filenames were case sensitive but I think this is a different problem.

Execution failed. Cannot cast from source type to destination type.

$
0
0

I've been working on an iOS & Android App (shared project) using Xamarin 5.0 and Xamarin.Forms, for some reason I can no longer run my Android app, I keep getting the message in the title of this question. I have totally uninstalled and reinstalled Xamarin Studio and associated pieces several times and tried several of the downloadable samples with the same results. The build always returns successfully but when I try and run the app on any emulator I get the same message. I can run the iOS app just fine.

I'm struggling to know what to do next and could use any pointers.

Cheers
Dan

iOS SearchBar in RelativeLayout Not Displaying

$
0
0

I'm trying to add a SearchBar into a RelativeLayout in Xamarin.Forms. It displays correctly on Android, but not on iOS. Has anyone run into this issue before, and know how to fix it? Here's the code snippet:

public class SearchPage : ContentPage
{
private SearchBar searchBar;

public SearchPage ()
{
searchBar = new SearchBar() {
Placeholder = "Search"
};
var layout = new RelativeLayout();
layout.Children.Add(searchBar,
Constraint.Constant(0),
Constraint.RelativeToParent((parent) => {
return parent.Y + 200;
}));
}));
Content = layout;
}
}

findViewById returns null

$
0
0

Hi, i'm writing an app, and all were perfectly fine before today. I've updated my project from office commit and found out that findViewById which worked fine now returns null, i've tried to use different layouts within their elements, but it returns null too. I've found similar thread on your forum and solution was to clean->rebuild project, this solution didn't work for me. If you have any suggestion please help me. Thank You(about my eng. i can just say that i'm from Ukraine=) )

I have Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION]

$
0
0

I've new with Xamarin. I've developed an application from the Xamarin Quick Start and was trying to run on a Nexus-7 and I'm having the following error:

Detecting installed packages
Waiting for packaging to complete
Installing application on device
Deployment failed because of an internal error: Unexpected install output: pkg: /data/local/tmp/Phoneword_Droid.Phoneword_Droid-Signed.apk
Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION]
Deployment failed. Internal error.

Could you help me please?

Thank you very much in advance,
Alfonso

ListView Text keeps repositioning after scrolling passed a list item

$
0
0

Having an issue with the ListView, my initial cell is larger than the preceding cells in the list. Consisting only of text placed in a label, the rest of the list items are only single lines of text that wrap when the screen is too small. On some resolutions this initial list item may take up a single screen on its own. If I scroll quickly to the bottom of a large list until that item is out of range and back up, the wrapped field of text changes to a single line, sometimes centered, sometimes aligned left or right, sometimes missing text having only 3 words!

Code is the same as the example listed here http://iosapi.xamarin.com/?link=T:Xamarin.Forms.ListView

All the packages are up to date with the latest versions. Has anyone else experienced this?


Any way to get a code file/line number from this?

$
0
0

MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: Can't add self as subview
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00000] in :0
at KleverLogic.FlashValet.iPhone.Valet.Application.Main (System.String[] args) [0x00000] in :0
NSInvalidArgumentException: Can't add self as subview

0 CoreFoundation 0x2f2c3f9b + 154
1 libobjc.A.dylib 0x39eb9ccf objc_exception_throw + 38
2 CoreFoundation 0x2f2c3ec5 + 0
3 UIKit 0x31aec535 + 108
4 UIKit 0x31aec4bf + 30
5 UIKit 0x31cb502f + 1402
6 UIKit 0x31af2ac5 + 72
7 UIKit 0x31cb4879 + 728
8 UIKit 0x31c71b27 + 2614
9 UIKit 0x31b8ed63 + 418
10 UIKit 0x31b8eb6d + 44
11 UIKit 0x31b8eb05 + 184
12 UIKit 0x31ae0d59 + 380
13 QuartzCore 0x3175e62b + 142
14 QuartzCore 0x31759e3b + 350
15 QuartzCore 0x31759ccd + 16
16 QuartzCore 0x317596df + 230
17 QuartzCore 0x317594ef + 314
18 QuartzCore 0x3175321d + 56
19 CoreFoundation 0x2f28f255 + 20
20 CoreFoundation 0x2f28cbf9 + 284
21 CoreFoundation 0x2f28cf3b + 730
22 CoreFoundation 0x2f1f7ebf CFRunLoopRunSpecific + 522
23 CoreFoundation 0x2f1f7ca3 CFRunLoopRunInMode + 106
24 GraphicsServices 0x340ff663 GSEventRunModal + 138
25 UIKit 0x31b4414d UIApplicationMain + 1136
26 KleverLogicFlashValetiPhoneValet 0x004f1398 KleverLogicFlashValetiPhoneValet + 4821912
27 KleverLogicFlashValetiPhoneValet 0x004b09cc KleverLogicFlashValetiPhoneValet + 4557260
28 KleverLogicFlashValetiPhoneValet 0x001b28b0 KleverLogicFlashValetiPhoneValet + 1419440
29 KleverLogicFlashValetiPhoneValet 0x0044d744 KleverLogicFlashValetiPhoneValet + 4151108
30 KleverLogicFlashValetiPhoneValet 0x00a07669 KleverLogicFlashValetiPhoneValet + 10155625
31 KleverLogicFlashValetiPhoneValet 0x00a515e1 KleverLogicFlashValetiPhoneValet + 10458593
32 KleverLogicFlashValetiPhoneValet 0x00a55503 KleverLogicFlashValetiPhoneValet + 10474755
33 KleverLogicFlashValetiPhoneValet 0x00a5534b KleverLogicFlashValetiPhoneValet + 10474315
34 KleverLogicFlashValetiPhoneValet 0x009f0e6d KleverLogicFlashValetiPhoneValet + 10063469
35 KleverLogicFlashValetiPhoneValet 0x00a9bc20 monotouch_IntPtr_objc_msgSend_IntPtr + 3708
36 KleverLogicFlashValetiPhoneValet 0x00111934 KleverLogicFlashValetiPhoneValet + 760116

How to open a email app (iPhone/android) to send a email

$
0
0

Hi, I'm using the Xamarin.Forms, and I have a button when the user tap this button, I would like to open the email app (iPhone/Android), with an email address.

var buttonContact = new Button{
Text=Helpers.Utility.emailAddressToContact,
HorizontalOptions=LayoutOptions.Center,
Command=new Command(async o =>{
//I only want to open the email app (Iphone/Android) to send a email.
//the email address I put in this variable (Helpers.Utility.emailAddressToContact)
})
};
stack2.Children.Add (buttonContact);

Thanks so much.

How do I get the AVPlayer to play an MP3 from a remote URL?

$
0
0

I've got the following code that I'm trying to get working. My previous AVAudioPlayer code worked, but didn't allow for remote files.

I can see the Player.Play(); method firing, but there's no audio coming from the speakers. What do I need to do to get the AvPlayer to play remote audio files?

public class AudioPlayer : IAudioPlayer
{
protected string FileName = string.Empty;
protected AVPlayer Player;

public bool IsPlaying { get; private set; }

public void Init(string fileName)
{
FileName = fileName;

QueueFile();
}

public async void Play()
{
do
{
await Task.Delay(5);
} while (Player.Status != AVPlayerStatus.ReadyToPlay);

Player.Play();
IsPlaying = true;
}

public void Pause()
{
IsPlaying = false;
Player.Pause();
}

public void Stop()
{
IsPlaying = false;
if (Player == null) return;
Player.Dispose();
Player = null;
}

public bool HasFile
{
get { return Player != null; }
}

private void QueueFile()
{
if (string.IsNullOrWhiteSpace(FileName))
{
throw new Exception("No file specified to play");
}

using (var url = NSUrl.FromString(FileName))
{
// if Player is null, we're creating a new instance and seeking to the spot required
// otherwise we simply resume from where we left off.
if (Player == null)
{
Player = AVPlayer.FromUrl(url);
if (Player == null)
{
// todo: what should we do if the file doesn't exist?
return;
}
}
}
}
}

Doubts related with a app with login page

$
0
0

I have this sample:

Office365RESTAPISample

That has a login page, contact view and edit contact view, the flow is:

LoginView > ContactView > EditContact

And I have some doubts:

Should I have to remove the login page from stack of navigation after I navigate to ContactsView, or should I keep it?
In my idea, I think after I do login and navigate to contact view and then do back using hardware button, the app should close and not navigate to login page,... or I am wrong?

If i need to remove the page from navigation stack, how I do this in Xamarin Forms?

Changed button text alignment after button clicked

$
0
0

Hello,

I am not sure why the button change text alignment after button clicked if the button is in a grid and there is a label and grid in StackLayout for android.

Here is a test case of the source code.

using Xamarin.Forms;

namespace ButtonTextAlignment
{
public class ContentPageGrid : ContentPage
{
public ContentPageGrid()
{
var layout = new StackLayout
{
Orientation = StackOrientation.Vertical,
Padding = 20
};

        var labelUsDollor = new Label
{
Text = "label",
TextColor = Color.White,
BackgroundColor = Color.Blue
};
layout.Children.Add(labelUsDollor);

var grid = new Grid
{
RowSpacing = 10
};

var button = new Button
{
Text = "Click me to test",
TextColor = Color.White,
BackgroundColor = Color.Blue,
WidthRequest = 400
};

button.Clicked += (sender, e) =>
{
labelUsDollor.Text = "button text change alignment";
};

grid.Children.Add(button, 0, 0);

layout.Children.Add(grid);
Content = layout;
}
}

}

Regards
Leigh

Viewing all 204402 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>