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

ListView Scrolling With Horizontal and Vertical

$
0
0

Hello My Xamarin Friends Today I am stuck on Listview and I have to try to Scrolling Listview Horizontally and Vertically Like this

So Don't understand how to archive this type of listview, Please Help me


REMOVING PAGE FROM NAVIGATION STACK AND CALLING POPASYNC SHOWS BLANK PAGE FOR A SECOND

$
0
0

Please find my below code:

private void OnNewUserButtonClick(object sender, EventArgs eventArgs)
{
for (var count = 1; count <= 3; count++)
{
Navigation.RemovePage(this.Navigation.NavigationStack[6 - count]);
}
Navigation.PopAsync();
}

=========================================

MY QUESTION:

On clicking the particular button, I want to remove the previous 3 pages and need to PopAsync; so that I will be navigating back to the page I want (ex., navigating from 6th page to 2nd page).

All works fine as expected but, on navigating, the page (ex., 2nd page) appears AFTER SHOWING BLANK SCREEN for a fraction of millisecond (0.5 Sec).

I have checked OnAppearing method in second page and I done nothing there for hiding the UI.

Is that a Xamarin Forms issue...?

Your response are well appreciated..

Thank you in advance.

how to set title of navigation bar to center?

$
0
0

in xamarin forms how to set title of navigation bar to center?

Google Map is Showing a blank screen in Android

$
0
0

Hi i am new to Xamarin. I created a map using the following link http://developer.xamarin.com/guides/android/platform_features/maps_and_location/maps/part_2_-_maps_api/
i followed all the procedures mentioned in it but what am getting is a blank screen. My application Output shows the following log on executing the map activity.

Open Connection
[REQUEST] DRD(41): 62|147
[REQUEST] Close
[REQUEST] Error processing: com.google.maps.api.android.lib6.b.d@42a1cef8 not retrying
[REQUEST] Retrying: com.google.maps.api.android.lib6.c.au@429ced70

Can anyone please tell me why this is happening.

Image from URI not showing up on Xamarin.Droid.

Source to learn Material Design for building Xamarin forms Application.

$
0
0

I want to build Xamarin forms application using Material design , so could any one suggest me the best source to learn Material Design for building Xamarin forms Application.

Using nightly build to test new FlowDirection property for Globalization

$
0
0

Like several other developers who design apps for right to left written languages, I was happy to see that the Forms roadmap indicates that work on the new FlowDirection is done. I've pulled down two different nightly builds in an effort to test the functionality. While intellisense appears to recognize the new syntax in XAML (I'm using VS2017), and the code builds without issue, when I attempt to deploy a simple

StackLayout Orientation="Horizontal" FlowDirection="RightToLeft" Spacing="0"
Label Text="Welcome to Xamarin.Forms!" VerticalOptions="Center" HorizontalOptions="Center"
StackLayout

I receive an error stating "No property, bindable property, or event found for FlowDirection" Is there a trick to using the nightly builds that I'm not aware of? I'm using Xamarin Live with a device running Android 7.0 API 24 for my testing purposes, if that helps.

Xamarin Forms (Android) How to do the Touch Test


Is it possible to allow the user to write a review in the application and then send it to the store

$
0
0

Hi,

So I've been asked to create a page where the user can enter a review for the application with a textbox for a review and a star rating control.

The design says that if the review is positive, I ask the user if he wants to share it on the PlayStore / App Store. I don't even know if that's possible. I would rather just ask the user if he likes the application and then redirect him to the store, but they would rather he types in the review in the application and then we send it over to the store.

How can I do that? I suspect it's either not possible or if it is, the user still needs to do the final action of accepting the review on the store page. Otherwise, if there was a method to send a review for the user why wouldn't some apps just create positive reviews and send them on the users behalf without their knowledge.

I know I can link to the App Store as a sort of "review my app link" or that with iOS I can ask for a store review popup but is it possible to pre-populate the review info in the app?

Why I cannot run project that has been created with Windows on Mac?

$
0
0

I always develop my project on my desktop, which has windows installed. I am going to have a presentation, and my laptop is a mac. I am trying to get the same code run on that mac. So, I copied the whole project folder to that mac, but I cannot even build any solution for that project. I intuitively thought it should possible and easy. Now, when I click "rebuild all" I got error message
"your project is not referencing the "monoandroid,version=v7.1" framework. add a reference to "monoandroid,version=v7.1" in the "frameworks" section of your project.json, and then re-run nuget restore"

Xamarin Forms app with specific file-types

$
0
0

I researched and found materials that tell me how to handle an application with specific file types.

I'm trying now to open my application when clicking on my file in the manager. It's working on Android 4.4, for example, but version 7.0 did not work.

When I searched, I found this explanation, from official Android 7.0 Changes:

For apps targeting Android 7.0, the Android framework enforces the StrictMode API policy that prohibits exposing file:// URIs outside your app. If an intent containing a file URI leaves your app, the app fails with a FileUriExposedException exception.
To share files between applications, you should send a content:// URI and grant a temporary access permission on the URI. The easiest way to grant this permission is by using the FileProvider class. For more information on permissions and sharing files, see Sharing Files.

I understand that it only accepts mime type, and it is not possible to use specific types.

Is that correct? Can not we open a custom file anymore? If yes, what alternative can I adopt?

Thanks!

Custom Pin

$
0
0

How to create a pin like in the image and inside the pin there is a uri image loaded ?!

Switch control throws Java.Lang.NullPointerException

$
0
0

Hi guys.
I want to add switch control to XAML:
<Switch IsToggled="{Binding IsAdult}" />

Here is my XAML file (I
<ContentPage.Content>







            <StackLayout Orientation="Horizontal" HorizontalOptions="Center">
                <Image 
                    Source="nick_icon.png" 
                    WidthRequest="30"
                    HeightRequest="30" />
                <Entry 
                    Placeholder="Nazwa użytkownika" 
                    FontSize="Default"/>
            </StackLayout>

            <StackLayout Orientation="Horizontal" HorizontalOptions="Center">
                <Label Text="Jestem osobą pełnoletnią"/>
                <Switch IsToggled="{Binding IsAdult}" />
            </StackLayout>

            <customs:RoundedSendButton 
                HorizontalOptions="Center"
                Text="SIGN UP" 
                TextColor="White"
                BackgroundColor="#f3b197"
                Margin="20, 0">
            </customs:RoundedSendButton>
        </StackLayout>
    </ScrollView>
</ContentPage.Content>

I inject ViewModel which works. When I run this in Android Emulator on Windows then I get:

Java.Lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference

I also tried:
<ContentPage.Content><Switch IsToggled="{Binding IsAdult}" /></ContentPage.Content>

So, the problem is related with . I tried to find something on the Internet, but I've not found a solution.

Do you know how to resolve it?

How to listen to Clipboard copy when App is in background

$
0
0

I want to listen to any copy activity to clipboard when app is onPause(), Then retrieve the word copied in an Entry field. I tried this but app crashes when I put it in the background:
in the App.xaml.cs class ..onPause() calling RegPrimaryClipChanged() method :

 public partial class App : Application
    {
        static bool bHasClipChangedListener = false;
        ClipboardManager ClipBoardManager  = (ClipboardManager) Forms.Context.GetSystemService(Context.ClipboardService);
        public App()
        {
            InitializeComponent();

            MainPage = new Translator.MainPage();
        }
static bool bHasClipChangedListener = false;
    ClipboardManager ClipBoardManager  = (ClipboardManager) Forms.Context.GetSystemService(Context.ClipboardService);
protected override void OnSleep()
        {
            // Handle when your app sleeps
            base.OnSleep();
            RegPrimaryClipChanged();

        }
     private void RegPrimaryClipChanged()
            {

                if (!bHasClipChangedListener)
            {
                    ClipBoardManager.AddPrimaryClipChangedListener(new OnPrimaryClipChangedListener());
                bHasClipChangedListener = true;
            }

     public class OnPrimaryClipChangedListener : Java.Lang.Object, ClipboardManager.IOnPrimaryClipChangedListener
            {
                ClipboardManager myClipBoard;

                public void onPrimaryClipChanged()
                {
                    ClipData clipData = myClipBoard.PrimaryClip;
                    //Toast.MakeText(Application.Current, 1, ToastLength.Short).Show();
                    ClipData.Item item = clipData.GetItemAt(0);
                    Translator.MainPage.likecount.Text = item.Text;
                }

                public void OnPrimaryClipChanged()
                {
                    throw new NotImplementedException();
                }
            }

Show softkeyboard when bluetooth keyboard is connected

$
0
0

Currently, i'm working on my first project with Xamarin forms and android. I have a bluetooth barcode scanner paired with android device. So softkeyboard doesn't appear when it's connected. I tried many options what i found in the internet. Such as forced softkeyboard call from CustomEntryRenderer and other places. In some cases it's possible to handle in Language/InputMethods menu in Android, but not in all phones. Maybe i'm missing something, and called code from wrong place. The question is how to show softkeyboard, even when bluetooth keyboard is connected?

     public void ShowKeyboard()
            {
                this.Control.RequestFocus();
                InputMethodManager inputMethodManager = this.Control.Context.GetSystemService(Context.InputMethodService) as InputMethodManager;
                inputMethodManager.ShowSoftInput(this.Control, ShowFlags.Forced);
                inputMethodManager.ToggleSoftInput(ShowFlags.Forced, HideSoftInputFlags.ImplicitOnly);
            }

     protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
            {
                base.OnElementPropertyChanged(sender, e);
                if (Control == null) return;
                if (e.PropertyName == ExtendedEntry.IsBorderErrorVisibleProperty.PropertyName)
                    UpdateBorders();
                if (((ExtendedEntry)this.Element).IsFocused)
                    ShowKeyboard();
            }

Xamarin.Forms Nuget package latest stable 2.5.1.444934

$
0
0

Question:

With all the resources available to Xamarin and the amount of testing that OUGHT to be done, why is it that a new stable release breaks every app project it is applied to? WHY?

If you're going to put out a new nugget release, MAKE SURE IT WORKS!

I can't even rollback gracefully without uninstalling a ton of dependencies first THEN reinstalling the LAST version that worked 2.5.0.280555 THEN reinstalling all the dependent plugins.

Just incredible!

WOW!

How to display the List of Folders and Files from Internal Memory into Listview in Xamarin Forms?

$
0
0

I want to show the list of folders,sub folders and files from internal memory into listview in xamarin Forms C#

How to change Entry border in Xamarin.Forms?

$
0
0

Hi All,

(Low Resolution Device Image)

(High resolution device image)

High Resoluiton device images

I want to show Entry control with Rounded Border (Refer Low Resolution device image) in High Resolution device.

Anyone idea how to achieve this scenario in Xamarin.Forms?

Regards,

Srinivasan

Platform specific RowHeight not working in Xamarin.Forms.

$
0
0

I'm defining a list view as follows:

<ListView Grid.Row="0" Grid.Column="1" ItemsSource="{Binding MenuList}"
                          SelectedItem="{Binding SelectedEngine, Mode=TwoWay}" SeparatorVisibility="None">
    <ListView.RowHeight>
        <OnPlatform x:TypeArguments="x:Int32">
            <On Platform="Android">52</On>
            <On Platform="UWP">154</On>
        </OnPlatform>
         </ListView.RowHeight>
</ListView>

But I get an error message saying:

No property, bindable property, or event found for 'RowHeight', or mismatching type between value and property.

And if I drop the <ListView.RowHeight> out it compiles. Does anyone know how I can fix the issue?

PCLCrypto library

$
0
0

Hello,

I am working on RSA cryptography on Xamarin.Forms, using PCLCrypto library , it gives error when I use "OpenAlgorith" method
var RsaObject = WinRTCrypto.AsymmetricKeyAlgorithmProvider.OpenAlgorithm(AsymmetricAlgorithm.RsaPkcs1);

the error is "PCLCrypto.NotImplementedByReferenceAssemblyException: This is a reference assembly and does not contain implementation. Be sure to install the PCLCrypto package into your application so the platform implementation assembly will be used at runtime."

I searched too much on the internet, but nothing worked with me, any help please.

Viewing all 58056 articles
Browse latest View live


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