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

Get type API response

$
0
0

Hello Developers,

I am call get type api it's status code StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1

But in this line i am getting text not json var Data = response.Content.ReadAsStringAsync().Result;

i Attach 3 image for show my issue

1. In image 1st getting text In coding.
2. In image 2nd api worked success i select text in postman then show text in response field that is show in coding.
3. In image 3rd i select Json in postman then show json in response field i need this json in coding.


Xamarin.Forms.WebView not loading URL ?

$
0
0
public class WebPage : ContentPage
{
    public WebPage ()
    {
        var browser = new WebView();
        browser.Source = "http://Xamarin.com";
        Content = browser;
    }
}

I tried the above coding, working fine. But when I change the URL, let say browser.Source = "http://google.com"... it is not working. The WebView is not loading, it is only load xamarin.com ... why?

Please help if anybody facing the same issue before and found the solution ... thanks in advance.

Android Marshmallow Permission issue for USBManager

$
0
0

Am creating an Android app using Xamarin forms, which will access USB host. When am trying this application in android device version is less than 6.0(Marshmallow) its working perfectly.

Below is the snippet i am trying out.

static string[] PERMISSIONS_EXTERNAL_STORAGE = {
            Manifest.Permission.ReadExternalStorage,
            Manifest.Permission.WriteExternalStorage,
        };

static readonly int REQUEST_USB_ACCESS = 0;

if ((int)Build.VERSION.SdkInt < 23) {
    UsbManager.RequestPermission(mDevice, mPermissionIntent); // Working for Anroid version below 23
} else {

    RequestUSBPermissionAccess(); // Displaying popup but when taps on allow sametime not able to UsbManager.HasPermission       orUsbManager.OpenDevice
}


void RequestUSBPermissionAccess()
{
    if (ActivityCompat.ShouldShowRequestPermissionRationale((Activity)Forms.Context, Manifest.Permission.ReadExternalStorage))
    {
        ActivityCompat.RequestPermissions((Activity)Forms.Context, PERMISSIONS_EXTERNAL_STORAGE, REQUEST_USB_ACCESS);
    }
    else
    {
        ActivityCompat.RequestPermissions((Activity)Forms.Context, PERMISSIONS_EXTERNAL_STORAGE, REQUEST_USB_ACCESS);
    }
}   

void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults)
{
    if (requestCode == REQUEST_USB_ACCESS)
    {

        if (grantResults.Length == 1 && grantResults[0] == Permission.Granted)
        {

        }
        else
        {
            OnRequestPermissionsResult(requestCode, permissions, grantResults);
        }
    }
}   

Need to implement the same

if (UsbManager.HasPermission (mDevice)) {                   
    mConnection = UsbManager.OpenDevice (mDevice);
    if (mConnection != null) {
        ...................
        ...................
    }
}

Working for Anroid version below 6.0 but when am trying with this code UsbManager.RequestPermission(mDevice, mPermissionIntent);

But not working for RequestUSBPermissionAccess(), each time UsbManager.HasPermission (mDevice) or UsbManager.OpenDevice (mDevice) is null.

Please anybody help me with the same issue.

Deeplinking in xamarin.forms?

$
0
0

Can any one help me how to open our app from URI ?

Thanks in advance.

carousel view with center image on top

$
0
0

Hi , I am trying to implement a carousel view which will look like cards view with center image on top same as this attached image, I tried several things but it did not worked , please give me any idea/suggestion how can I implement this.

Thanks.

Binding data to UltimateXF chart from view model

$
0
0

I am using https://nuget.org/packages/UltimateXF/ charts in my app and I know how to set data from code behind. My problem is I want to know how to bind data from view model.

     <StackLayout Orientation="Vertical" Padding="2" VerticalOptions="FillAndExpand" Grid.Row="1">
              <Label Text="Target/achievement" FontSize="Default" TextColor="DarkSlateGray"/>
              <Label Margin="10,-5,0,0" HorizontalOptions="StartAndExpand" Text="4000/5000" FontSize="18" TextColor="Black"/>
              <ultimateChart:SupportHorizontalBarChartExtended HeightRequest="60" x:Name="lineChart" Margin="0,0,0,0" HorizontalOptions="FillAndExpand"/>
</StackLayout>

This is how I bind data from code behind....

            var labels = new List<string>();
            var lineEntries = new List<EntryChart>();

            lineEntries.Add(new EntryChart(0, 500));
            lineEntries.Add(new EntryChart(1, 200));

            labels.Add("Gene");
            labels.Add("Life");

            var lineDataSet4 = new BarDataSet(lineEntries, "")
            {
                Colors = new List<Color>{
                    Color.LightSalmon
                }
            };

            var lineData4 = new BarChartData(new List<IBarDataSet>() { lineDataSet4 });

            lineChart.ChartData = lineData4;
            lineChart.DescriptionChart.Text = "";
            lineChart.AxisLeft.DrawGridLines = false;
            lineChart.AxisLeft.DrawAxisLine = true;
            lineChart.AxisLeft.Enabled = true;

            lineChart.AxisRight.DrawAxisLine = false;
            lineChart.AxisRight.DrawGridLines = false;
            lineChart.XAxis.Granularity = 1f;
            lineChart.HeightRequest = 10;
            lineChart.AxisRight.Enabled = false;

            lineChart.XAxis.XAXISPosition = XAXISPosition.BOTTOM;
            lineChart.XAxis.DrawGridLines = false;
            lineChart.XAxis.AxisValueFormatter = new TextByIndexXAxisFormatter(labels);

How can I implement instagram and twitter posts into a Xamarin.forms project?

$
0
0

I'm trying to add text posts from Twitter and Instagram Images from a specific account to update and view ina Xamarin.Forms App. Is there a NuGet package or up to date API tutorial that can explain how to do this? any help would be greatly appreciated.

Estimados amigos, como puedo utilizar sesiones, estoy utilizando visual estudio 2019

$
0
0

Estoy utilizando visual studio 2019 y aun no hay mucha información al respecto, según vi foros anteriores utilizan un paquete settings pero al parecer no se encuentro en en esta nueva versión, les agradecería mucho su ayuda. Gracias.


Xamarin Forms (iOS) - Intermittent "Please select a valid device before running the application"

$
0
0

While debugging a Xamarin Forms project on an iOS device, I will intermittently encounter "Please select a valid device before running the application". When this happens the Visual Studio 2017 IDE will show an active (green) "Paired to Mac - MacBook Air (connected)" is displayed. I can stop and restart Visual Studio and everything is fine ... for about 10 ~ 30 minutes. I have only one instance of Visual Studio running at any given time, and no one else shares this Mac. I have even rebuild my Windows 10 Pro machine as good measure. Rebooting the Mac does not seem to help either.

[MAC]
macOS Mojave 10.14.4
Xcode 10.2.1 (10E1001) April 17. 2019

[PC]
Windows 10 Pro Version 1809 OS Build 17763.437
Visual Studio 2017 Version 15.9.11
Xamarin 4.21.3.83
Xamarin.Designer 4.16.30
Xamarin.Templates 1.1.128
Xamarin.Android SDK 9.17.0
Xamarin.iOS and Xamarin.Mac SDK 12.4.0.64
.NET Framework Version 4.7.03190

Any ideas?

Shell - Navigate into inner tab of a different Shell

$
0
0

Hello,
I have a main shell page 'AppShell.xaml' with Flyout navigation
In this shell I have 2 FlyoutItem with a single ShellContent (we call it Page1 and Page2) and 1 FlyoutItem with 4 ShellContent (4 tab pages)

From Page1 I need to go into a sandwitch page (with upper and bottom tabs)
For this way I write a second shell page (CoreShell.xaml) with Flyout disabled.

CoreShell.xml:
`<?xml version="1.0" encoding="UTF-8"?>

<Shell.Resources>
    <ResourceDictionary>

    <Style x:Key="BaseStyle" TargetType="Element">  
        <Setter Property="Shell.ShellTabBarBackgroundColor" Value="{StaticResource tabBarBackgroundColor}" />  
     </Style>

    <Style x:Key="SicurezzaStyle" TargetType="Element" BasedOn="{StaticResource BaseStyle}">            
        <Setter Property="Shell.ShellTitleColor" Value="{StaticResource tabSecurityFontColor}" />    
        <Setter Property="Shell.ShellTabBarTitleColor" Value="{StaticResource tabSecurityFontColor}" /> 
        <Setter Property="Shell.ShellForegroundColor" Value="{StaticResource tabSecurityFontColor}" />
    </Style>

    <Style x:Key="SmartHomeStyle" TargetType="Element" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="Shell.ShellTitleColor" Value="{StaticResource tabSmartHomeFontColor}" />
        <Setter Property="Shell.ShellForegroundColor" Value="{StaticResource tabSmartHomeFontColor}" />
    </Style>

    <Style x:Key="ClimaStyle" TargetType="Element" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="Shell.ShellTitleColor" Value="{StaticResource tabClimaFontColor}" />
        <Setter Property="Shell.ShellForegroundColor" Value="{StaticResource tabClimaFontColor}" />
    </Style>

    <Style x:Key="SistemaStyle" TargetType="Element" BasedOn="{StaticResource BaseStyle}">
        <Setter Property="Shell.ShellTitleColor"  Value="{StaticResource tabSistemaFontColor}" />
        <Setter Property="Shell.ShellForegroundColor" Value="{StaticResource tabSistemaFontColor}" />
    </Style>                  
    </ResourceDictionary>

</Shell.Resources>

<ShellItem>
    <Tab Icon="tab_security_unsel"  Title="Sicurezza" Style="{StaticResource SicurezzaStyle}" >    
        <ShellContent Title="Scenari"        ContentTemplate="{DataTemplate view:ScenariPage}" />
        <ShellContent Title="Aree e zone"   ContentTemplate="{DataTemplate view:AreeZonePage}" />
        <ShellContent Title="Telecamere"    ContentTemplate="{DataTemplate view:TelecamerePage}" />
    </Tab>

    <ShellContent Icon="tab_smart_home_unsel" Title="Smart Home" Style="{StaticResource SmartHomeStyle}" 
                  ContentTemplate="{DataTemplate view:SmartHomePage}" />

    <ShellSection Icon="tab_clima_unsel" Title="Clima" Style="{StaticResource ClimaStyle}">
        <ShellContent Title="Clima 1" ContentTemplate="{DataTemplate view:WaitingClimaPage}" />
    </ShellSection>

    <ShellSection Icon="tab_system_unsel" Title="Sistema" Style="{StaticResource SistemaStyle}">
        <ShellContent Title="Generali"  ContentTemplate="{DataTemplate view:GeneraliPage}" />
        <ShellContent Title="Guasti"  ContentTemplate="{DataTemplate view:GuastiPage}" />
        <ShellContent Title="Eventi"  ContentTemplate="{DataTemplate view:EventiPage}" />
    </ShellSection>        

</ShellItem>

`

To show the sandwitch page, I push this Shell page to Navigation;
CoreShell coreShell = new CoreShell();
await Shell.Current.Navigation.PushAsync(coreShell);

and all is working as expected. Of course in this way I see the first upper tab of the first bottom tab

My questions:
1) There is a way to open the coreShell page to a different inner tab?
2) There is a way to add ShellContent to a ShellSection programmatically from behind code? For example, for 'Clima' ShellSection the number of tab is not fixed, and I could build it runtime

Thanks
Matteo

How is the best way to dynamically CRUD controls at run time??

$
0
0

Hello I am slowly working on an application to control my home automation - I am looking to allow the user to change the items that will be available.
I need to CRUD controls dynamically as the user interacts with the Form so that initially a StackLayout has only a button but allows the user to change the cell/widget to be a NEW widget to control 1 or more items in the house. Below is a mockup screenshot of this using a single light switch as an example seems I cannot post screenshots, I also have a widget for seeing RTSP streams from POE cameras, a widget for monitoring items like doors, etc., Basically the sky is the limit. I am adding a snippet of my test xaml below ... I am still playing with sizes and layouts but any attempts so far seem hackish and want to get the best may to tackle this.

Questions?
1. I am having trouble setting a x:Name to the dynamic controls and am asking if this is a Bug? if not why ?
2. I was trying to set a Name to the Button controls in code so when it is clicked so I would try and determine the correct REST call yo make. Is there another way to achieve this without a name for the controls?
3. Is there a better way to do want I am trying to do? I started to look at FlexLayout but that did not seem right either.
4. Is there are alternative to having to use StackLayouts to get my layout set?
5. I just read a search online were the guys said to add all the control to the Layout and then turn the Visibility on or off to get the desired look as the user selects a new layout. This seems VERY odd is this really a good way to statically have controls in xaml?

Thank you in advance.
Brad

<StackLayout  HorizontalOptions="StartAndExpand"  VerticalOptions="Start"  >
    <StackLayout Orientation="Horizontal">
        <StackLayout Orientation="Horizontal">
            <StackLayout Orientation="Vertical" >
                <Frame x:Name="A" CornerRadius="5"  HasShadow="True" BorderColor="Black" IsVisible="True" Margin="5" Padding="5"    >
                    <StackLayout Orientation="Horizontal" >
                        <StackLayout Orientation="Vertical" HeightRequest="200"  >
                            <Label Text="Webcam Porch" />
                            <Image x:Name="webcam" Margin="0, -120, 0, 0"  Source="{Binding WebImage}" WidthRequest="300" HeightRequest="400" />
                        </StackLayout>
                    </StackLayout>
                </Frame>

                <StackLayout Orientation="Vertical" >
                    <Frame CornerRadius="5"  HasShadow="True" BorderColor="Black" IsVisible="True" WidthRequest="125" HeightRequest="75" Margin="5" Padding="5"    >
                        <StackLayout Orientation="Horizontal"    >
                            <StackLayout Orientation="Vertical" >
                                <Image Source="switch_off.png" WidthRequest="60" HeightRequest="60" Margin="0,1,0,0" />
                            </StackLayout>
                            <StackLayout Orientation="Vertical" >
                                <Button Text="On" BorderRadius="2" WidthRequest="60" HeightRequest="33" Margin="-5,0,0,0" Padding="0,0,0,0" />
                                <Button Text="Off" BorderRadius="2" WidthRequest="60" HeightRequest="33" Margin="-5,-10,0,0" Padding="0,0,0,0" />
                            </StackLayout>
                        </StackLayout>
                    </Frame>
                    <Frame CornerRadius="5"  HasShadow="True" BorderColor="Black" IsVisible="True" WidthRequest="125" HeightRequest="75" Margin="5" Padding="5"    >
                        <StackLayout Orientation="Horizontal"    >
                            <StackLayout Orientation="Vertical" >
                                <Image Source="switch_off.png" WidthRequest="60" HeightRequest="60" Margin="0,1,0,0" />
                            </StackLayout>
                            <StackLayout Orientation="Vertical" >
                                <Button Text="On" BorderRadius="2" WidthRequest="60" HeightRequest="33" Margin="-5,0,0,0" Padding="0,0,0,0" />
                                <Button Text="Off" BorderRadius="2" WidthRequest="60" HeightRequest="33" Margin="-5,-10,0,0" Padding="0,0,0,0" />
                            </StackLayout>
                        </StackLayout>
                    </Frame>
                    <Frame CornerRadius="5"  HasShadow="True" BorderColor="Black" IsVisible="True" WidthRequest="125" HeightRequest="75" Margin="5" Padding="5"    >
                        <StackLayout Orientation="Horizontal"    >
                            <StackLayout Orientation="Vertical" >
                                <Image Source="switch_off.png" WidthRequest="60" HeightRequest="60" Margin="0,1,0,0" />
                            </StackLayout>
                            <StackLayout Orientation="Vertical" >
                                <Button Text="On" BorderRadius="2" WidthRequest="60" HeightRequest="33" Margin="-5,0,0,0" Padding="0,0,0,0" />
                                <Button Text="Off" BorderRadius="2" WidthRequest="60" HeightRequest="33" Margin="-5,-10,0,0" Padding="0,0,0,0" />
                            </StackLayout>
                        </StackLayout>
                    </Frame>
                </StackLayout>
            </StackLayout>

Telerik Imagepicker for Android or Ios?

$
0
0

Hello. Does anyone know if telerik has a good way for picking single image from gallery that works for both Android and Ios? I have other than that seen jamesmontemagnos library but don't know if it really works?

HttpWebRequest-The remote server returned an error: (400) Bad Request

$
0
0

i am working on push notification with onesignal .i am getting some error while requesting to web server,like HttpWebRequest-The remote server returned an error: (400) Bad Request and System.Net.WebException: Value cannot be null. Parameter name: src. any body know about this ,please help me... here is my code

using System.IO;
using System.Net;
using System.Text;

var request = WebRequest.Create("https://onesignal.com/api/v1/notifications") as HttpWebRequest;

request.KeepAlive = true;
request.Method = "POST";
request.ContentType = "application/json; charset=utf-8";

request.Headers.Add("authorization", "Basic My_API_Key");

byte[] byteArray = Encoding.UTF8.GetBytes("{"
                                        + "\"app_id\": \"My_app_id\","
                                        + "\"contents\": {\"en\": \"English Message\"},"
                                        + "\"filters\": [{\"field\": \"tag\", \"key\": \"level\", \"relation\": \">\", \"value\": \"10\"}]}");

string responseContent = null;

try {
    using (var writer = request.GetRequestStream()) {
        writer.Write(byteArray, 0, byteArray.Length);
    }

    using (var response = request.GetResponse() as HttpWebResponse) {
        using (var reader = new StreamReader(response.GetResponseStream())) {
            responseContent = reader.ReadToEnd();
        }
    }
}
catch (WebException ex) {
    System.Diagnostics.Debug.WriteLine(ex.Message);
    System.Diagnostics.Debug.WriteLine(new StreamReader(ex.Response.GetResponseStream()).ReadToEnd());
}

System.Diagnostics.Debug.WriteLine(responseContent);

Transition into Xamarin.Forms from Xamarin.Android front page

$
0
0

I want my start page be Xamarin.Android (largely for faster loading) and then transition into Xamarin.Forms when Xamarin.Forms is ready to be shown. How would I do this? The Xamarin.Android page should allow interaction in the meantime. I'm thinking either switching activities or hiding the Xamarin.Android view to reveal Xamarin.Forms when it loads. But will hiding the view work? I'm not sure how Xamarin.Forms is shown since it doesn't make use of Android views.

Other concerns include where to detect and show Xamarin.Forms only after it is ready to be shown, and where async is needed. I think I read somewhere that Intent and StartActivity are automatically run in the background if I use those. I suppose that just means GUI doesn't stop?

How Loaders will be aligned vertically center in iOS by using ACR.UserDialogs Package?

$
0
0

In Android by using ACR.User Dialogs loaders are aligned vertically center but when it comes to iOS loaders are not coming center(coming at top).Can anyone help me to resolve this?
Thank You


Setting shadow on detail page in MasterDetailPage

$
0
0

I am trying to recreate this UI.

Screenshot

I'm using a MasterDetailPage. In the existing app the background of the master page and the detail page are white. To separate them, the detail page has a shadow around it.

The detail page also needs to be a NavigationPage.

I noticed the Frame has a HasShadow property.

If I make my detail page a ContentPage with a Frame I can get the shadow effect. However, I can't put a NavigationPage as a child of a Frame.

If I make my detail page a NavigationPage, any Frame in it doesn't also surround the titlebar.

Any suggestions?

User Dialog Loading is not appearing center of the page in iOS

$
0
0

I am using Acr.UserDialogs to show/hide loading panel. Functionality side its working perfect in Android & iOS. In iOS, the loading dialog doesn't appear center of the page, whereas in Android it's fine.

Xamarin, need to know country where user it is login...

$
0
0

I have develop a Xamarin app consuming Azure resources like Azure functions.
Apps it works in any place over the world.
Architecture it is defined by tenant (aligned to Azure tenant).
So I would like use the same app in any place so I need to know before user signing which country is login, to redirect to appropriate Azure resource.
I found some methods, but I could not return country information based on GPS position.
Any idea.
Thanks

Getting Size of ContentView for Custom Renderer

$
0
0

Let's say I've got a simple XAML page like so, where CameraView is just a ContentView within a Frame:

<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:SelfieMirroring" x:Class="SelfieMirroring.MainPage">
    <!-- Place new controls here -->
    <Grid x:Name="mainGrid" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Label x:Name="mainLabel" Grid.Row="0" Text="Welcome to Xamarin.Forms!" HorizontalOptions="Center" VerticalOptions="CenterAndExpand" />
        <Frame Grid.Row="1" x:Name="cameraFrame">
            <local:CameraView x:Name="mainCamera" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"></local:CameraView>
        </Frame>
    </Grid>
</ContentPage>

<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="SelfieMirroring.CameraView">
    <ContentView.Content>
    </ContentView.Content>
</ContentView>

Then I've got a Custom Renderer like so, except that Control is null, but e.NewElement isn't.

using System;
using Xamarin.Forms;
using SelfieMirroring;
using Xamarin.Forms.Platform.iOS;
using UIKit;
using AVFoundation;

[assembly: ExportRenderer(typeof(CameraView), typeof(SelfieMirroring.iOS.CameraViewRenderer))]
namespace SelfieMirroring.iOS
{
    public class CameraViewRenderer : ViewRenderer<CameraView, UIView>
    {
        AVCaptureDevice device;
        AVCaptureDeviceInput input;
        AVCaptureSession session;
        AVCapturePhotoOutput photo;

        UIView layoutPanel;

        CameraView view;

        public CameraViewRenderer()
        {
        }

        public void SetupCamera()
        {
            // to do
        }

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

            if (Control == null)
            {
            }

            if (e.OldElement != null)
            {
            }

            if (e.NewElement != null)
            {
            }
        }
    }
}

How can I get the ContentView's Width and Height within the Custom Renderer's allocated width and height for the Frame that Xamarin set, so that I can base a UIView off of it to display the preview layer for the camera?

It returns in e.NewElement as -1 and -1 for the width/height. I don't want to know or explicitly set its width/height at design time though because it may be different for different devices. Surely the actual on-screen rendered dimensions of the Xamarin Forms components that were rendered are kept somewhere that I can reuse.

How to create a grid of square buttons?

$
0
0

Hello,
I'm new to Xamarin and currently trying to move my Android activity to a Xamarin Content Page. The activity contains a grid (few linear layouts) of square shaped buttons of equal size - I would post a screenshot, but this page doesn't allow me to - ,,you have to be around for a little longer to post links"... That's also the reason why I had to remove xmnls references. That's pretty annoying to be honest.
I've written a following piece of XAML code:

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns="..."
                 xmlns:x="..."
                 x:Class="TravelGuide.MainPage">
        <ContentPage.Content>
            <ScrollView>
                <Grid x:Name="MainGrid">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                <Button Text="Text..."
                x:Name="btn1"
                VerticalOptions="CenterAndExpand"
                HorizontalOptions="Center"
                HeightRequest="{Binding Width, Source={x:Reference btn1}}"
                Grid.Row="0"
                Grid.Column="0"/>

                <Button Text="Text2..."
                x:Name="btn2"
                VerticalOptions="CenterAndExpand"
                HorizontalOptions="Center"
                HeightRequest="{Binding Width, Source={x:Reference btn2}}"
                Grid.Row="0"
                Grid.Column="1"/>

                <Button Text="Text3..."
                 x:Name="btn3"
                VerticalOptions="CenterAndExpand"
                HorizontalOptions="Center"
                HeightRequest="{Binding Width, Source={x:Reference btn3}}"
                Grid.Row="0"
                Grid.Column="2"/>
            </Grid>
        </ScrollView>
    </ContentPage.Content>

Unfortunately, it doesn't work if I put a long text inside of a button - the button automatically resizes to fit the text.
How to prevent that?

Viewing all 81910 articles
Browse latest View live


Latest Images

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