Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all 91519 articles
Browse latest View live

Disable scroll in ListView

$
0
0

Hi!

Is it possible to disable scrolling in a ListView if you have only a few items?

Thanks

// Johan


Is that any way to use custom fonts in xamarin forms and get output in all platform?

$
0
0

better in xaml file and use font family attribute

How to set margin for NavigationPage.SetTitleIcon

$
0
0

Hello,

I use this line to set the logo of my application : NavigationPage.SetTitleIcon(this, "navbarlogo.png");

I want to set top and left margin.

Is it possible ? If not, I think some code inside renderers will do the job but I don't know how to do.

Is it possible to help me to achieve these change ?

Regards

Does the Timed Local Notification functionality in the Local Notifications Plugin work on Windows?

$
0
0

Cross-posting from the Components forum, as that forum doesn't seem to get much attention...

Does the Timed Local Notification functionality in the Local Notifications Plugin work on Windows platforms (UWP and WinRT 8.1)? Other than setting the Toast capable property, is there anything else required? I am seeing the timed notifications on Android and iOS, but only the non-timed ones on Windows platforms.

Multiline label get wrong width

$
0
0

Why Label and LightStackLayout dont expand to his parent width?

Content=new LightStackLayout
{
    Orientation = StackOrientation.Horizontal,
    BackgroundColor = Color.Green,
    Children =
              {
                  new LightStackLayout
                  {
                      Orientation = StackOrientation.Vertical,
                      VerticalOptions = LayoutOptions.FillAndExpand,
                      HorizontalOptions = LayoutOptions.FillAndExpand,
                      BackgroundColor = Color.Blue,
                      Children =
                      {
                          new Label
                          {
                              BackgroundColor = Color.Red,
                              Text="12"
                              HorizontalOptions = LayoutOptions.FillAndExpand,
                          }
                      }
                  }
              }
};

Get this:
image

If i replace "Text="12"" to "Text = "123123 132 23 2323 23322223 66666666"" i get this
image

Why Label and LightStackLayout dont expand to his parent width?

how to reference a library in PCL ? It says incompatible Target Framework

$
0
0

I'm using Xamarin Studio on MAC. I created a Xamarin.Forms project. It created 3 project. 1-PCL, 2-iOS,3-Android projects.
Now I created another project called "WSServices" via Right click solution, Add new project, scrolled to the bottom choose "Other" group and there I selected ".NET" and then choose "Library"... So "WSServices" is created as 4th project in the solution.

When I try to reference this "WSServices" in the PCL project it says "WSServices (Incompatible Target Framework: . NetFramework, Version=v4.5.1).
I went to "WSServices" options and I tried to select all the TARGETFRAMEWOK -> none of them help....

So the question is How can I refer in my PCL another Assembly (library - reusable code)....

ps: This "WSServices" will use System.Web.Webservices etc. Now it's set to Target Framwork 4.5.1, because needed for System.XML.Serialization

my Xamarin version 6.1.4 (build 1) -> Stable!

see image...

Please advice?

ObjectDisposedException in VisualElementRenderer (Android)

$
0
0

Hi Xamarin Team.

We have been battling an intermittent issue in the last several weeks with an System.ObjectDisposedException being thrown in the VisualElementRenderer for Android. Looking on the forums and BugZilla, there have been many similar reports with slightly different repros. However, it seems isolated to a fairly recent release of Xamarin.Android and/or Xamarin.Forms.

Here is an abbreviated stack trace showing the exception thrown.

Unhandled Exception: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Android.Views.GestureDetector
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].Android.Views.View.IOnTouchListener.OnTouch...VisualElementRenderer.cs:104

We have a custom collection view control which we have built which is rendered using a UICollectionView on iOS, RecyclerView on Android and GridView on UWP. This view has been considered stable code for some time now and has been working flawlessly for many months. However, we noticed this exception when we upgraded to XF 2.3.3 and subsequently updated to the latest release of Xamarin.Android in the stable channel.

We note a similar issue has already been reported in several BugZilla reports.
https://bugzilla.xamarin.com/show_bug.cgi?id=42678
https://bugzilla.xamarin.com/show_bug.cgi?id=45330
https://bugzilla.xamarin.com/show_bug.cgi?id=47158

On one of the bug reports, it was suggested ObjectDisposedExceptions could be related to the new Tarjan GC which is the default in Xamarin.Android 7.0 We testing switching to MONO_GC_PARAMS=bridge-implementation=old and this solved the problem.

Looks like the new Tarjan GC Bridge may be being a little too aggressive when cleaning up. We were wondering if the peculiarities of RecyclerView may also be connected to the problem.

We are happy to put together a sample project with a repro and post a bug report if this is useful.
Anyone else been seeing this issue?

its so easy but i dont know why i cant solve it

$
0
0

Im trying to show a message for several second and it must be closed automaticly , exactly like pop up without any buttons

i tried to install toast plugin with no any luck of success what should i do ?


Is it possible to add a banner advertising to my xamarin.forms app?

$
0
0

I could not find a solution for banner implementation. The api from admob does not work for windows phone or uwp. Also i can not add a banner via admob or anything with the pcl project. The banner will be shown always at the bottom of the app. I would like to develop the ui in xaml in the pcl project. I found a discussion with a custom renderer. But it was not a banner advertising. Is it possible to add a advertising in a xamarin.forms app for all plattforms or at least for android and apple?

Xaml Compilation - Object reference not set to an instance of an object

$
0
0

When trying to use XAML Compilation i always get this issue when building:

1> Module: TestApp.dll
1> Resource: TestApp.Page1.xaml...
1> Parsing Xaml... done.
1> Replacing Page1.InitializeComponent ()... failed.
1> C:\ProyectosInvestigacion\TestApp\TestApp\TestApp\TestApp.Page1.xaml : error : Object reference not set to an instance of an object.
1> at Xamarin.Forms.Build.Tasks.SetNamescopesAndRegisterNamesVisitor.CreateNamescope()
1> at Xamarin.Forms.Build.Tasks.SetNamescopesAndRegisterNamesVisitor.Visit(RootNode node, INode parentNode)
1> at Xamarin.Forms.Xaml.RootNode.Accept(IXamlNodeVisitor visitor, INode parentNode)
1> at Xamarin.Forms.Build.Tasks.XamlCTask.Compile()

I've done a simple TestProject in which i added one Xaml page and configured it to compile:

    [XamlCompilation(Xamarin.Forms.Xaml.XamlCompilationOptions.Compile)]
    public partial class Page1 : ContentPage
    {
        public Page1()
        {
            InitializeComponent();

        }
    }

And the Xaml here:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="TestApp.Page1">
  <Label x:Name="lblText" Text="{Binding MainText}" VerticalOptions="Center" HorizontalOptions="Center" />
</ContentPage>

This always throws "Object reference not set to an instance of an object" on the Error List using Visual Studio 2013, Xamarin Forms 2.1.0.6529
I'm attaching the whole solution so anyone can reproduce this error.

Is there a known way to get Xaml Compilation working?

Having difficulty getting a Grid inside a ScrollView to work.

$
0
0

Hi All,

Maybe this is very easy but I cannot seem to get this XAML to work. Basically the goal is to handle landscape orientation on devices easily. I seem to be missing something very simple. Unfortunately I can only see examples where a StackLayout is being used instead of a Grid - could this be the reason?

Any thoughts on the matter? All help here is greatly appreciated.

Regards,
Intelligence4

Searchbar in Navigation bar Or TabbedPage

$
0
0

Hi, I was having trouble trying to get a searchbar inside the navigation bar. Then i read it wasn't possible because it only accepts ToolBarItems.
So now im trying to put the searchbar at the top of a tabbedpage where the navigation bar was. But it wont let me put anything other than a page in the TabbedPage.

<SearchBar Placeholder="Search"/>
<TabbedPage.Children>

    <custom:ContactsTab Title="Contacts" Icon="contacts_icon.png"/>
    <custom:ConversationsTab Title="Conversations" Icon="conversations_icon.png"/>

</TabbedPage.Children>

Can't access API Classes[IPushNotification] from xam.plugin.pushnotification in XF PCL project

$
0
0

I'm trying to use Push Notification plugin [https://github.com/rdelrosario/xamarin-plugins/tree/master/PushNotification] inside my Xamarin forms app.

I would like to keep notification receive part in shared code. So that I don't have to use any extra code on each platform. Which results in implementing IPushNotificationListener inside PCL project. But I don't have access to it inside the PCL project.

I don't have access to CrossPushNotification either.

So it means I have to create/initialize/listen push code in each platform?

Not able to use resgen on Mac to generate .cs strongly types resource class file

$
0
0

I am using .resx for string resources in my Xamarin.Forms project. I have a TextResources.resx file and it generates a TextResources.Designer.cs file when compiled from Xamarin Studio. The properties of the .resx files are:
Build Action - EmbeddedResource
Custom Tool - PublicResXFileCodeGenerator

However the problem is with our automated build using CLI. The xbuild command is not supposed to generate the TextResources.Designer.cs file and hence the build fails. I need to use the resgen utility to generate this file and include it as a build step before running xbuild.

But, on a Mac the following resgen command does not work and shows up the Usage guide instead.
resgen /src:cs TextResources.resx

Can someone share their experiences on this please?

Suggest me what can i do

$
0
0

I want that when i click on an image i shud get a list view and after selecting any item from a list view that image shud have that selected text.
what can i do???


Installed Forms.GoogleMaps and got a System.TypeLoadException

$
0
0

I hava a xamarin forms solution where I try to insert GoogleMaps (using nuget)
https://github.com/amay077/Xamarin.Forms.GoogleMaps

But after I added it I get an exception after the splashscreen has been showed and I Init the Forms.

Exception is
System.TypeLoadException: Could not resolve type with token 0100000e

Got it at this line of droid app
global::Xamarin.Forms.Forms.Init(this, bundle);

Kind of new to xamarin development so I need help finding what causes this exception. I'm guessing there is an error adding some dll or something?

UWP and Xamarin.Form.Themes

$
0
0

Some have Enable mode the Xamarin.Forms.Theme in Universal Windows Application?

XF + Azure Mobile App + Offline Sync

$
0
0

Appreciate any help regarding issue in my XF + Azure Mobile App + Offline Sync.
Common Startup Flow A:
1.) Create azure service objects (MobileServiceClient)
2.) Create db store objects (MobileServiceSQLiteStore)
3.) Register entity to sqlite table via DefineTable()
4.) MobileServiceClient.SyncContext.InitializeAsync()
5.) Check for cached auth token

Branch Flow B : Invalid/No Token found (First launch)
6.) Display login page (XF)
7.) Perform custom authentication via MobileServiceClient.InvokeApiAsync()
8.) Extract GWT auth token from response (failed scenario is omitted here)
9.) Cache auth token for future usage (with token expiry info)

Branch Flow C : Valid Token found (Subsequent launch)
10.) Create azure service user from token (MobileServiceUser)
11.) Associate user to azure service object
MobileServiceClient.CurrentUser =
MobileServiceClient.CurrentUser.MobileServiceAuthenticationToken =
12.) Perform synchronisation
MobileServiceClient.SyncContext.PushAsync()
MobileServiceClient.GetSyncTable().PullAsync()

My problem is, when i do flow A->B->C, my synchronisation is not returning from PushAsync().
Once I force closed my app and re-launch into flow A->C, everything will work properly (PushAsync() completes and PullSync() retrieve data from remote).
I also tried to remove the "redundant" PushAsync() in step #12, but still face the same issue where synchronisation became not returning from PullAsync().

Anyone used VideoJS for Forms?

$
0
0

I'm thinking of using VideoJS in a WebView for Android and iOS. Anyone had a chance to play with it? Does it work on mobile?

ScrollView horizontal - completely disable vertical scroll

$
0
0

I'm looking to implement a horizontal scroll area within my app. It all works fine using Orientation="Horizontal" apart from one thing - WIndows and iOS still allows you to drag and scroll vertically before bouncing back to the scroll area. Is there any way to disable this?

I've looked at the Windows Phone API and iOS and they both seem to have options for this.

WindowsPhone => VerticalScrollBarVisibility="disabled"
iOS => set bounces property to false,

Do I need to look at implementing a custom renderer to implement this?

Viewing all 91519 articles
Browse latest View live


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