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

Loading a Sqlite db file embedded as a ressource file

$
0
0

Can I, directly from PCL code in a XF app, open up a SQLite file using GetManifestResourceStream ? Or do I need to first copy the file in the user's space in each platform prior to open it (hence using dependency service) ? The SQLite DB is intended to be exclusively read-only!

Thanks


[Android] Lag (white screen) when switching Master-Detail page

$
0
0

Hi,

I have noticed that all versions of XForms above 2.3.0.107 have introduced 'lag' when switching between Master-Detail pages. The navigation menu slides away, but then the page goes white for a few seconds before loading with a little animation. Previously, the page title would update immediately after selection and page content soon after that.

Having a look at the release notes between 2.3.0.107 and 2.3.0.114 I found this,

  • Isolate fragment management for children of MasterDetailPage. If an AppCompat MasterDetailPage hosts NavigationPages or TabbedPages in either the > Master or Detail sections, those pages are now wrapped in their own Fragment (and use that Fragment's ChildFragmentManager) to isolate their Fragment management operations and avoid recursive entry into the executePendingTransactions() method. Also fixed a disposal bug in the custom MDP renderer in Control Gallery. [see 40333, 40639]

Maybe there is some kind of fragment animation taking place?

Regards,
Daniel.

Visual Studio restarting when deploying to windows phone 8.1 device

$
0
0

Newly I see a strange behavior of my Xamarin Forms projects: Building and deploying apps to a Windows Phone 8.1 device (Debug Mode, ARM) results in stopping and restarting Visual Studio 2015 in about 80% of the trials. Deploying to the winphone 8.1 emulator is OK. Deploying to the other platforms (Android, IOS, UWP) works without a problem to emulators and devices.
Messages from VST: "Visual Studio stopped working... Trying to find a solution... Visual Studio is restarting" (Screenshots).
This behavior is also showing with a newly generated empty Forms project (Blank Xaml project, portable). Same results with Visual Studio on my notebook, and same results on different devices (Nokia 630 and Samsung AtivS).

  • Visual Studio Community 2015, Version 14.0.25431.01 Update 3

  • Xamarin Forms 2.3.3.180

Thanks for every answer!!

Effect doesn't work with binding

$
0
0

Because we have our own fonts and accessibility sizing I made effects to render label text, this works for hard coded text but not for text injected via binding. Anybody knows why and how to resolve it?

Works

    <Label Style="{StaticResource BodyTextStyle}" Text="Title">

        <Label.Effects>
            <local:BodyStyleFontEffect />
        </Label.Effects>

    </Label>

Doesn't

    <Label Style="{StaticResource BodyTextStyle}" Text="{Binding Title}">

        <Label.Effects>
            <local:BodyStyleFontEffect />
        </Label.Effects>

    </Label>

Compiling Error: Xamarin.iOS.Common.targets

$
0
0

Xamarin Studio 6.0(build 5174)

From Errors:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: Error: Error executing task ReadItemsFromFile: Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 3, position 2.

From LogFile:

Target _ReadCoreCompileInterfaceDefinitions:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: error : Error executing task ReadItemsFromFile: Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 3, position 2.
Build FAILED.
Errors:

    /Users/simplesolutionsMAC/Documents/Projectos/JunaNote/iOS/JunaNote.iOS.csproj (Build) ->

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets (_ReadCoreCompileInterfaceDefinitions target) ->

        /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: error : Error executing task ReadItemsFromFile: Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 3, position 2.

         0 Warning(s)
         1 Error(s)

    Time Elapsed 00:00:00.2195200

Cant change android back button in Xamarin.Forms

$
0
0

Hi all,
I tried 10120312 ways to change back button in toolbar at Xamarin.Forms, but still it same color. It change hamburger menu color, but doesn't change <- !!!

  1. Create custom toolbar theme. - Not working.
  2. Try to get drawable of back button and change color filter. - Not working
  3. Try do some custom change with theme. - Not working

Just one thing help me, to change
<item name="colorControlNormal">#F00</item>
In theme style , but it change all dividers and all widgets lines (EditText etc)

Please help me get out of this.

I wanted to auto generate thumbnails based on the type of files i have in a folder.

$
0
0

I wanted to auto generate thumbnails for different types of files (PDF,URLs,Docs,MP4s Etc.). When i tap on the thumbnails i wanted them to display in respective views.

Stayed Logged In in Xamarin.Forms

$
0
0

Hi All,
May I ask about how to let the user stayed Loggedin in Xamarin.Forms?


How to: Use Acr.UserDialogs.DatePrompt ?

$
0
0

Hi there!

I'd like to use DatePrompt dialog from Acr.UserDialogs, but I don't have any idea about how to.

var dpc = new DatePromptConfig();
dpc.OkText = "Ok";
dpc.CancelText = "Cancel";
dpc.IsCancellable = true;
dpc.MinimumDate = DateTime.Today;
dpc.MaximumDate = DateTime.Today.AddDays(2);
dpc.Title = "DatePrompt Dialog";

dpc.OnAction....= .... // I NEED HELP HERE. HOW CAN I USE OnAction ?

UserDialogs.Instance.DatePrompt(dpc);

Best regards,

HttpGet with authorization header

$
0
0

I need to retrieve some json data from web service, specifically FCM, but I can't find how to do that with and authorization header.

I was trying to use the following code:

            var request = (HttpWebRequest)WebRequest.Create(new Uri(url));
            request.ContentType = "application/json";
            request.Method = "GET";

but I can't put the necessary authorization header. I don't find nothing specific and clear of how to do this.

Need help

Selecting Text When Enrty is Focused

$
0
0

I want users to overwrite text when they focused to the Entry with some default Text. Placeholders doesn't work for me. I need to select the text whenever I click to Entry. Is its possible?

[PRISM] Retrieve data when tab page is active (tabbed page)

Overview button pressed event

$
0
0

I want to know how to handle the android overview button pressed event in Xamarin.Forms.

How to change the Status Bar Style ?

$
0
0

I've a Page and from that page I just jump to other page like Page 1====>Page 2
by using that code ...

            NavigationPage ppNav = new NavigationPage(new HtmlPage("PrivacyPolicy.html", Constants.PRIVACY_POLICY, true));
            ppNav.BarTextColor = Color.White;
            this.Navigation.PushModalAsync(ppNav);

Well I want a White Status Bar Icon in my app.
The problem is when I set BarTextColor to white then every thing works perfect but the Navigation Bar Title turns White and when I set BarTextColor to some other color then the status bar changes to black color .. What's the solution of this ? Also don't say to use a PushAsync...

Try to move and resize a UIView after user make actions at screen #iOS

$
0
0

Hello Guys

We try build a Video Call Screen like whatsapp but we have a little problem when try to MOVE and RESIZE a UIVIEW at iOS.

When we change the UIVIEW Frame it changes its place, but it does not resize. We are using Xamarin.Forms with Custom Renderer.

On Android we can make it work using the Animations class.

Anyone can help? Follow part of code:

protected override void OnElementChanged(ElementChangedEventArgs<VideoCallControl> e)
        {
            base.OnElementChanged(e);

            if (Control == null)
            {
                videosViews = new UIView(Bounds)
                {
                    BackgroundColor = Xamarin.Forms.Color.Transparent.ToUIColor(),
                };

                SetNativeControl(videosViews);
            };

            if (this.Element == null) return;

            myVideo = new PortSIPVideoRenderView()
            {
                Frame = new CoreGraphics.CGRect(UIScreen.MainScreen.Bounds.Width - 155, 30, 135, 200),
                //AutoresizingMask = UIViewAutoresizing.None
            };

            remoteVideo = new PortSIPVideoRenderView()
            {
                Frame = new CoreGraphics.CGRect(0, 0, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height)
                //AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight

            };

            Element.OnCallStart += (sender, evArgs) =>
            {
  var newFrame = myVideo.Frame;
                newFrame.X = UIScreen.MainScreen.Bounds.Width - 155;
                newFrame.Y = 30;
                newFrame.Width = 135;
                newFrame.Height = 200;
                myVideo.Frame = newFrame;
                //newFrame.Size = new CoreGraphics.CGSize(135, 200);
                //myVideo.RemoveConstraints(myVideo.Constraints);
                //myVideo.AutosizesSubviews = true;
                //myVideo.Layer.Frame = new CoreGraphics.CGRect(UIScreen.MainScreen.Bounds.Width - 155, 30, 20, 20);
                //myVideo.LayoutIfNeeded();
                //myVideo.LayoutSubviews();
                //myVideo.UpdateConstraints();
             };



            myVideo.initVideoRender();
            remoteVideo.initVideoRender();

            videosViews.AddSubview(remoteVideo);
            videosViews.AddSubview(myVideo);
        }

How to Center a Layout inside another Layout?

$
0
0

So I have Two Layouts . Relative and Stack. Stack is the Child of Relative. So I want to vertically center the Stack relative to the Parent Layout. How to do it?

Dismiss Numeric Keyboard

$
0
0

How do you dismiss the numeric keyboard, there is no "Enter" or "Done" key. Clicking on the background does not dismiss it either.

google Map Styling

problem assembly with same simple name

$
0
0

Hi, i have this problem atach image. Help me please. Start when i update xamarin.

How to access controls defined in a ListView DataTemplate?

$
0
0

Hi,
Lets say I have a ListView in 'MyView' as follows:

<ListView x:Name="myList" ItemSource="{Binding MyData}">
  <ListView.ItemTemplate>
    <DataTemplate>
      <ViewCell>
        <StackLayout>
          <Label Text="{Binding FieldLabel}"/>
          <Entry x:Name="myEntry" Text="{Binding MyEntry}">
            <b:Interaction.Behaviors>
              <b:BehaviorCollection>
                <b:EventToCommand EventName="Completed" CommandParameter="{Binding .}" Command="{Binding Path=BindingContext.EntryCompletedCommand, Source={x:Reference Name=MyView}}"/>
              </b:BehaviorCollection>
            </b:Interaction.Behaviors>
          </Entry>
        </StackLayout>
      </ViewCell>
    </DataTemplate>
  </ListView.ItemTemplate>
</ListView>

MyData has x items in it, lets say 10.

How can I set focus to the next entry field to the next item from within the EntryCompletedCommand event? and when the last one is 'completed' then focusing the first entry in the listview?

I've searched for a while now and have not found a straight forward answer!

Viewing all 91519 articles
Browse latest View live