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

iOS - Button command are not fired when the keyboard of an entry/editor is open

$
0
0

Hi,
I have a contentpage with a scrollview that display an entry and a button. When I finish to write in the entry, I want to click on the button that will fire a command.
In Android, this works.
In iOS, the button is pressed (because the color is changed) but the only event that happens is the keyboard closure. I have to click a new time to send my command. The command could be fired with the return key on the keyboard but I want to keep the button.
I put my entry and my button in a stacklayout and all is working fine in iOS.
I tested several things like putting my entry and my button in a contentview in the scrollview or testing renderers but nothing. I have the same behavior with an editor.

So, why I have this behavior and how I get ride off, please?
Thanks a lot for your help!

Anaïs


Anyone know how to change placeholder text color with Xamarin Forms?

$
0
0

Does anyone know how to change placeholder text color with Xamarin Forms? I assume i'm going to have to build a custom renderer, but I haven't built one yet and wasn't sure if anyone know a good way to handle this.

how to get attachment form device in xamarin froms

$
0
0

how to get attachment form device in xamarin froms.

Toolbar items placement

$
0
0

Hello

I have some "how to do" interrogations about toolbars in my cross platform app (ios and android)

  • How to place the title at center? In Android it's on left and not displayed at all in ios
  • I already have a settings icon, but if i manage to center the title i would like to display another icon on the left of the toolbar (at same place as usual hamburger menus)

Is there a way to manage it in portable code, or i have to deal with each OS separately?

Thanks

How to Change Image Resolution,width,height in Xamrin.Forms?

$
0
0

in my project i need compress image size is possible to do in Xamarin.Forms ?

iOS 11 Accelerometer not working

$
0
0

Hi,

I'm trying to retrieve accelerometer information from a Xamarin Forms app.
It works great on iOS 10 but not on iOS 11.

Do you know if there is any issue or something different between them?

regards

Code behind for merged ResourceDictionary

$
0
0

I have a project (project 1) that defines a ResourceDictionary (it's a net standard 1.4 project).
I then have a project (project 2) that merges and adds to that ResourceDictionary.

In xaml, everything is fine. I can reference any resource simply using

{StaticResource resourceName}

and it doesn't matter which assembly it is in.

However one of my views in Project 2 is being built using code and I reference the resource with

(Color)Application.Current.Resources["resourceName"];

This works if the resource is defined in Project 2, but not if it is defined in Project 1.

Any ideas?

Fire base notification

$
0
0

Hi,

I need to implement fire base notification for xamarin forms .
Can you please send me any example code or any step by step information.

Thanks


JSON vs Database

$
0
0

hi,
Newbie here. I need to access some static data. For example, basic information about all the hospitals in the country or in a state.
I'm wondering, should I create a JSON file with all those info and add it as an embeded-resource and deserialize it during app start; or should I have a database in my server and get the info by calling API?
What would be the right approach?

I tried with the 1st approach (ie. embeded JSON file) with very small data set deserilized asynchronously ; not seems like its little slow to start up. But once its running no problem.

Any advice would be much appreciated.

On Property Change, Can't Hide or Display Grid/Label

$
0
0

I am not new to Xamarin Forms, but kind of failed to understand why the does not hide when some properties change.

My Grid:
<Grid Grid.Row="0" BackgroundColor="Red" IsVisible="{Binding IsNetworkError}" x:Name="GridA"> </Grid>

It's C# code; ...xaml.cs;

[XamlCompilation(XamlCompilationOptions.Compile)] public partial class NetworkErrorBottom { protected ViewModel net = new ViewModel(); public NetworkErrorBottom () { InitializeComponent (); GridNetworkError.IsVisible = net.IsNetworkError; } }

I have another file in ViewModel which controls the change;

public class BaseViewModel : INotifyPropertyChanged{ private bool _isNetworkError; public bool IsNetworkError { get { return _isNetworkError; } set { _isNetworkError = value; OnPropertyChanged(); } } }

Network.xaml file, which holds the GridA gets embedded into the main page, and IsVisible = False by default. I want to display GridA only if no network by setting IsReloadPreviousPage = true

Network check is done from another class

public void NetworkCheck(){ if(!Connected){ ViewModel.IsNetworkError = true; } }

Please note: GridA get displayed/hidden if IsReloadPreviousPage is hard coded inside the ViewModel.

Where I am I getting it wrong? Any Idea guys?

Thanks.

Can't see ALL the Labels inside the ViewCell

$
0
0

Hi guys,
Newbee here. I've a List view which contains 3 Labels and 1 button. After rendering, I see only the 1st Label; rest of the objects are not there.
Here is my XAML:

`
<ListView.ItemTemplate>


                                    <StackLayout VerticalOptions="FillAndExpand" 
                                                 HorizontalOptions="FillAndExpand" Orientation="Vertical">
                                        <Label Text="{Binding ContactName}" 
                                                                    Font="Bold,20"
                                                                    VerticalOptions="StartAndExpand" 
                                                                    HorizontalOptions="StartAndExpand" />
                                        <Label Text= "{Binding PhoneNumber}"
                                                                   FontAttributes="Italic"
                                                                   VerticalOptions="StartAndExpand" 
                                                                   HorizontalOptions="StartAndExpand" />
                                        <Label Text= "{Binding OpenUntil}"
                                                                   FontAttributes="Italic"
                                                                   VerticalOptions="StartAndExpand" 
                                                                   HorizontalOptions="StartAndExpand" />
                                        <Button BackgroundColor="Green" Text="Call" Clicked="OnCallClicked"
                                                                VerticalOptions="End" HorizontalOptions="End"/>
                                    </StackLayout>
                            </StackLayout>
                         </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>`

Any advice would be much appreciated.

No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp users may not

$
0
0

Hi,
I am struggling with the following error when i run the xamarin forms in the android environment.

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Warning: 1. No -tsa or -tsacert is provided and this jar is not timestamped Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2047-04-07) or after any future revocation date. (C2C.Droid)

Can any one please help me out this. My iOS project is working fine and android deployment and build was successful my android white screen and suddenly app got stopped

Given Key Not Present in Dictionary Xamarin Forms

$
0
0

I Have a Login ViewModel something like this below

public class LoginViewModel : ViewModelBase
    {

        private readonly IAuthenticationService _authenticationService;

        public LoginViewModel(IAuthenticationService authenticationService)
        {
            _authenticationService = authenticationService;
        }
  } 

And i'm Binding like this in XAML

<ContentPage.BindingContext>
    <viewModels:LoginViewModel />
</ContentPage.BindingContext>

When i Compile i'm getting "Given Key Not Present in Dictionary"

But when i add an Empty Constructor to My ViewModel like this

      public LoginViewModel ()
            {

            }

It working fine ,so is there any workaround for this other than instantiating from Code behind of my ViewPage ?

Text Missing from Page when shown with PushAsync but visible when shown with PushModalAsync

$
0
0

Has anyone come across this issue with Xamarin Forms (2.5.0.122203) where Labels and other text don't show on a child page of a NavigationPage when it's invoked via Navigation.PushAsync but it works fine when invoked via Navigation.PushModalAsync?

I have a video of the issue in action here youtu.be / c24s76nIp1s
(Sorry, had to space it becuase I need to be around for a little while longer!!)

I have tried downgrading Xamarin Forms to 2.4 but the issue persists!

Change DatePicker minimum width 296 to lesser width.

$
0
0

The DatePicker does not resize when width is smaller than 296. It will be cutoff. What is the possible workaround to correct it?


How i can reduce size or stream of image in xamarin forms?

$
0
0

var file = await Plugin.Media.CrossMedia.Current.PickPhotoAsync(new Plugin.Media.Abstractions.PickMediaOptions
{
PhotoSize = Plugin.Media.Abstractions.PhotoSize.Medium
});

    if (file == null)
        return;


    AppApplication.Instance().NewImage = file.GetStream();

    ProfileIcon.Source = ImageSource.FromStream(() =>
    {
        var stream = file.GetStream();
        file.Dispose();
        return stream;
    });

I am trying to reduce size of image which i am selecting from gallery using Plugin.media
How i can reduce size or stream of image in xamarin forms?

How to show Animation in Page Transitions ?

$
0
0

Hi All,

I'm building a XForms app where I'm using Tabbed Page control.
But while Navigating to another page the transition of the space occupied by tabbed page is observable quite clearly which actually looks kind of odd.
So what I was thinking is to implement some Animation kind of thing which will hide this transition of the tabbed page space.

What I need is to show some kind of Animation while transition(navigation) happens from the Tabbed page to Another & vice-versa.
Any help would be appreciated.

Thanks,
Priyabrata

Microsoft azure login page

$
0
0

Is there any way to customize the azure AD login page with company branding.

Master Detail Page Back Button

$
0
0

At first, I made my project using this site
And i can navigate ohter pages through master(hamburger menu)

This is my question.
If i tapped a row of datagrid at ClientPage, it will navigate to ClientDetailPage.
And i can return ClientPage by clicked Navigation Back Button, But!! Hambuger menu icon is disappeared...

//MainPage.xaml
public MainPage()
{
InitializeComponent();
IsPresented = false;
menuList = new List();

            var page1 = new MasterPageItem() { Title = "Client Management", Icon = "ic_import_contacts_black.png", TargetType = typeof(CleintManagementView) };
            var page2 = new MasterPageItem() { Title = "WOD Management", Icon = "", TargetType = typeof(WODManagementView) };
            var page3 = new MasterPageItem() { Title = "Statics", Icon = "", TargetType = typeof(Statics) };

            menuList.Add(page1);
            menuList.Add(page2);
            menuList.Add(page3);

            MenuList.ItemsSource = menuList;
            Detail = new NavigationPage((Page)Activator.CreateInstance(typeof(CleintManagementView)));
}
        #region MasterDetail MenuList Selected
        private void MenuList_ItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            var item = (MasterPageItem)e.SelectedItem;
            Detail = new NavigationPage((Page)Activator.CreateInstance(item.TargetType));
           IsPresented = false;
        }

//ClientPage
private void dataGrid_GridDoubleTapped(object sender, Syncfusion.SfDataGrid.XForms.GridDoubleTappedEventsArgs e)
{
var masterDetail = App.Current.MainPage as MasterDetailPage;
var nav = new NavigationPage();

            var nextPage = new ClientManagementDetailView();
            var selected = e.RowData as People;
            nextPage.BindingContext = selected;
            nextPage.PassContext();
            masterDetail.Detail.Navigation.PushAsync(nextPage);
        }

ClientPage

ClientPage->Double Tapped->ClientDetailPage

Hamburger menu is disappeared..

Facebook & Google Login with Xamarin Forms using Xamarin.Auth

$
0
0

I know this should be trivial, but I haven't found a working example of loggin in using facebook or google for Xamarin Forms using Xamarin.Auth
Can anyone share a working project or point me to a repository with a working example?

Viewing all 58056 articles
Browse latest View live


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