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

Webview not scrolling inside of Frame

$
0
0

The following code prevents the WebView from scrolling a Xamarin forms application running in UWP

<ContentPage.Content>
    <Frame >
        <Grid >
            <WebView Source="I can not post link put your address here" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
        </Grid>
    </Frame>
</ContentPage.Content>

Where code without the frame works fine.

<ContentPage.Content>
        <Grid >
            <WebView Source="can not post links put your web address here" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
        </Grid>

</ContentPage.Content>

Any ideas on how to resolve or work around this without removing the frame? Is there something I am missing or is this a bug?


How to set corner radius for button in xamarin uwp by programatically?

$
0
0

I am having an grid holding in Button. I want to set corner radius for this button by programmatically in xamarin.uwp. If it possible means i want to set corner radius for Bottom left alone. Please suggest your ideas for this query.

Adding search bar to navigation bar in iOS 11

$
0
0

Has anyone been able to add a UISearchController to the navigation bar in iOS 11, when LargeTitles = true ? I can set the the NavigationItem.TitleView to a UISearchBar object, but it doesn't look good. Setting NavigationItem.SearchController to a UISearchController doesn't do anything; no search bar is displayed. Heres the code:

if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
{
    // doesn't work. No search bar is displayed
    var searchController = new UISearchController((UIViewController)null);
    navigationItem.SearchController = searchController;
    navigationItem.HidesSearchBarWhenScrolling = false;

    // This works, but doesn't look good (search bar is too small & overlaps the top part of the Large Title)
    // var searchBar = new UISearchBar();
    // ...
    // navigationItem.TitleView = searchBar;
}

Create a Service with a UI

$
0
0

I'm trying to create an overlay after I press a start button (when I say overlay I mean like the Facebook messenger overlay that stays on top of everything). So far I was able to do this using the code below. This works just fine, but I don't like creating my "view" programmatically, I would rather lay it out in XAML somewhere. How do I go about doing this and then loading it? This may be a stupid/simple question, but I'm just starting out with Android / Xamarin so forgive my ignorance.

public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
    public void HandleStartClick()
    {
        var serviceIntent = new Intent(this, typeof(OverlayService));
        this.StartService(serviceIntent);
    }
}

[Service(Label = "OverlayService", Icon = "@mipmap/icon")]
public class OverlayService : Service
{
    public override void OnCreate()
    {
        base.OnCreate();
        var windowManager = this.GetSystemService(WindowService).JavaCast<IWindowManager>();
        var button = new Button(this) { Text = "Test" };
        var layoutParams = new WindowManagerLayoutParams(
                                        ViewGroup.LayoutParams.WrapContent,
                                        ViewGroup.LayoutParams.WrapContent,
                                        WindowManagerTypes.ApplicationOverlay,
                                        WindowManagerFlags.NotFocusable,
                                        Format.Translucent)
                                    {
                                        Gravity = GravityFlags.Top | GravityFlags.Left,
                                        X = 0,
                                        Y = 50
                                    };
        windowManager.AddView(button, layoutParams);
    }
}

SwipeGestureRecognizer is not working in nested stackLayout --> Xamarin.Form version 3.3.0.967583

$
0
0

I tried applying GestureRecognizer to Outer stack layout / to ScrollView / to inner stack layout / to image also, but its not working

                <!--Banner Scroll-->
                <ScrollView  Orientation="Horizontal" x:Name="bannerScroll" IsEnabled="true" 
                             InputTransparent="False" >
            <ScrollView.GestureRecognizers>
                <SwipeGestureRecognizer Direction="Left" Swiped="SwipeGestureRecognizer_Swiped">

                </SwipeGestureRecognizer>
            </ScrollView.GestureRecognizers>
                    <!--Banner layout-->
                    <StackLayout Padding="0,0,0,0" x:Name="SlidingStack" Orientation="Horizontal" 
                            VerticalOptions="CenterAndExpand" InputTransparent="False">

                        <Image x:Name="image" Source="download1.jpg" 
                            WidthRequest="255" Aspect="Fill" InputTransparent="False" >
                        </Image>
                        <Image x:Name="image1" Source="download2.jpg" 
                            WidthRequest="255" Aspect="Fill" InputTransparent="False"></Image>
                        <Image x:Name="image2" Source="download3.jpg" 
                            WidthRequest="255" Aspect="Fill" InputTransparent="False"></Image>

                    </StackLayout>
                    <!--End Banner layout-->

                </ScrollView>
                <!--End Banner Scroll-->
</StackLayout>

MasterDetailPage MasterBehavior not being respected

$
0
0

When testing my app under a 10" tablet (Asus Transformer Pad K101), the MasterBehavior (SplitOnLandscape) is being respected, and the app is behaving as expected. However, when running the device on a slightly smaller tablet (Asus MeMO Pad 8"), this option seems to be ignored - I'm unable to force a permanent split in landscape mode. Does anyone have any suggestions for a fix?

Also, it appears that the docstrings for the MasterBehavior options are incorrect - "Detail" is switched with "Master". i.e. MasterBehavior.Split has the docstring "Details are always displayed in a split screen", MasterBehavior.Popover has the docstring "Details pop over the page". Should these not be "Master is always displayed in a split screen" and "Master pops over the page" respectively?

Debug build show "Could Not get traitsetID for iPhone 11,2" problem

$
0
0

Hi guys I build an cross platform app to an iPhoneXS with ios 12.0, and get this Error

"Could Not get traitsetID for iPhone 11,2"

Any one know why ? Thx

Is it possible to increse the height of a progressbar?

$
0
0

Im sure it should be using a custom renderer, I already know how to change the progress color and the track color. However, I need the bar to look bigger and not jusst a small line, is there a way to accomplish this ?

Thanks!


Run code after remote notification on both OS

$
0
0

Hello developers,

I'm using firebase cloud message to send notifications for my app and it is working pretty good.

However, I need to run few lines of code after the notification goes up when the app is closed( not in background), for both OS. You can imagine that I'm saving logs of notifications in a txt file. How can I do that? Where should I write my code?

I'm trying to do that on this sample: https://github.com/yamachu/TryFirebaseXamarin

Best Regards!

Akavache -- The parameter is incorrect

$
0
0

I have an xamarin.forms app that requires storing some information, and for this I used Akavache, and it works fine.
The problem I have is when I try to update the nuget package. I install everything, and it works fine for android and for iOS, but when I try to run on UWP, I keep getting an error, "The parameter is incorrect" and "0xdef00003 - Unspecified error occurred." It looks like these errors are caused by Akavache and Akavache.sqlite3. I downgraded those two packages back to the version 6.0.0-alpha0038, and it works fine again.

Anyone else run into this problem and know what to do about it?
Any advice would be greatly appreciated.

Is there an easy way to display an ActivityIndicator over the top of other layout?

$
0
0

Can anyone suggest a way or point me at code to display an ActivityIndicator, ideally over the top of any existing visual elements already in the XAML tree?

Two possible ways of doing this come to mind. I could include an ActivityIndicator somewhere in the XAML for each page and simply make is visible and invisible as required. Or a better solution would probably be to add the ActivityIndicator to the visual tree using code when required. My use case allows for either of these solutions.

The only way I have got this to work so far is to add the ActivityIndicator into a cell of a Grid, which is not ideal and certainly isn't an option on all screens. So I'd be extremely grateful if anyone can point me at something to help with this.

Kind wishes ~ Patrick

Confilict

$
0
0

Severity Code Description Project File Line Suppression State
Error NU1107 Version conflict detected for Xamarin.Android.Support.Compat. Install/reference Xamarin.Android.Support.Compat 27.0.2.1 directly to project ALOROUBAH.Android to resolve this issue.
ALOROUBAH.Android -> Xamarin.Android.Support.v7.MediaRouter 27.0.2.1 -> Xamarin.Android.Support.v7.Palette 27.0.2.1 -> Xamarin.Android.Support.Compat (= 27.0.2.1)
ALOROUBAH.Android -> Com.Airbnb.Xamarin.Forms.Lottie 2.6.3 -> Xamarin.Android.Support.Design 27.0.2 -> Xamarin.Android.Support.Compat (= 27.0.2). ALOROUBAH.Android E:\Mob Applications\ALOROUBAH\ALOROUBAH\ALOROUBAH.Android\ALOROUBAH.Android.csproj 1

Closing Picker when master of masterdetail is closed

$
0
0

I've created a master/detail view where the master page contains a picker. Unfortunately when the master is closed by swiping or clicking the search button, the picker stays open and is shown above the content of the detailpage.

Who knows a solution to force close the picker when the master is closed?

This only happens on IOS, on Android the picker is shown as popup which is closed when swiping or clicking somewhere else.

Is there a way to change a ListView visually based on a bound property?

$
0
0

I have a ListView that shows a list of devices. Tapping one of these initiates connection, which can take some time. I have an IsBusy property in the view-model, which becomes true while a connection is in progress. I have bound the ListView.IsEnabled property to this and it successfully blocks more taps on the ListView while a connection is in progress.

I would like to give some visual indication to show that the ListView cannot be tapped but there doesn't seem to be any way to do this. I have tried triggers on the ListView and on the visual elements in the ListView (e.g. a Label.TextColor property). Nothing seems to work.

Does anyone know how to do this?

one Signal nuget error

$
0
0

NU1107: Version conflict detected for Xamarin.Android.Support.Compat. Install/reference Xamarin.Android.Support.Compat 27.0.2.1 directly to project ALOROUBAH.Android to resolve this issue.
ALOROUBAH.Android -> Xamarin.Android.Support.v7.MediaRouter 27.0.2.1 -> Xamarin.Android.Support.v7.Palette 27.0.2.1 -> Xamarin.Android.Support.Compat (= 27.0.2.1)
ALOROUBAH.Android -> Com.Airbnb.Xamarin.Forms.Lottie 2.6.3 -> Xamarin.Android.Support.Design 27.0.2 -> Xamarin.Android.Support.Compat (= 27.0.2).
Package restore failed. Rolling back package changes for 'ALOROUBAH.Android
'.

i'm using vs2017 latest version
xamarin forms : latest version


i tried to install one signal ---> depends on ====Xamarin.Android.Support.Compat
then ==> try to install Xamarin.Android.Support.Compat ===> depends on =====> Xamarin.Android.Support.Core.Ui
then ==> try to install Xamarin.Android.Support.Core.Ui===> depends on =====> Xamarin.Android.Support.Compat (again) so i'm in infinite loop


what can i do ???????????


Confilict versions

$
0
0

Severity Code Description Project File Line Suppression State
Error NU1107 Version conflict detected for Xamarin.Android.Support.Compat. Install/reference Xamarin.Android.Support.Compat 27.0.2.1 directly to project ALOROUBAH.Android to resolve this issue.
ALOROUBAH.Android -> Xamarin.Android.Support.v7.MediaRouter 27.0.2.1 -> Xamarin.Android.Support.v7.Palette 27.0.2.1 -> Xamarin.Android.Support.Compat (= 27.0.2.1)
ALOROUBAH.Android -> Com.Airbnb.Xamarin.Forms.Lottie 2.6.3 -> Xamarin.Android.Support.Design 27.0.2 -> Xamarin.Android.Support.Compat (= 27.0.2). ALOROUBAH.Android E:\Mob Applications\ALOROUBAH\ALOROUBAH\ALOROUBAH.Android\ALOROUBAH.Android.csproj 1

How to determine if a Xamarin Forms platform is MacOS and WPF

$
0
0

I'm using "Xamarin.Essentials: File System Helpers" at https://docs.microsoft.com/en-us/xamarin/essentials/file-system-helpers?context=xamarin/xamarin-forms&amp;tabs=android and the platform specifics tabs only contain Android, iOS, and UWP.

As this does not include WPF, I presume that I can use the essentials library for Android, iOS, and UWP, however for this I need to write specific implementations to cater for MacOS and WPF.

How do I determine if an OS is MacOS or WPF?

The Xamarin.Forms.TargetPlatform enumeration has Android, iOS, Windows, Other, WinPhone, which is not helpful.

Any ideas - other than me creating my own TargetPlatform service?

Kind regards,

Anthony

HotReload LiveReload LiveXaml [Mac] [Windows] [nuget package] [opensource]

Not able to reference Xamarin.Essentials in .Android project

$
0
0

I have added Xamarin.Essentials to all the projects. But when I try to put in the setup code in ManiActivity's OnCreate event, Xamarin.Essentials is not referenced. It is not in the References too. Unable to add it separately. The NuGet explorer shows that it is installed for Android project too.

My Android project is targeted to V8.1 and Android Support Libraries are of V27.0.2.1 as required by the documentation.

What am I missing?

can't submit information the popup to Content Page

$
0
0

how can submit information when close modal popup and redirect to
Content Page using R.g.Plugins.Popup

Viewing all 81910 articles
Browse latest View live