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

Multi-line Label with tail truncation

$
0
0

Is a Label in XF configurable to support multi-line (wraps) and tail truncation at the same time? In iOS, I can do this by specifying the number of lines on a UILabel and specifying tail truncation. If not, I can also go the custom renderer route.


Multi line label with ellipse

$
0
0

i am having an issue with multiline label on Xamarin form(Android). my use case is in side listview row have 3 labels vertically aligned. based on the space availability it should occupy the space like 2 lines or 3 lines after it should apply ellipse. Its working correctly on IOS using custom render but not in the Android. i tried to solve using below code on LabelRender onElementchanged event
((TextView)Control).SetMinLines (0);
//((TextView)Control).SetLines (3);
((TextView)Control).SetMaxLines (3);
((TextView)Control).Ellipsize = global::Android.Text.TextUtils.TruncateAt.End;

On IOS we achieved using this properity MaxLineOccupancy="2". but its not working in Android.

please help us to resolve it. Thanks in advance.

Customize Frame for only top left and bottom left corner in iOS?

$
0
0

Hi,

I've been trying to customize the frame with only top left and bottom left corner in iOS. I tried below code but its not working:
var rect = new CGRect(0,0,
UIBezierPath mPath = UIBezierPath.FromRoundedRect(this.Layer.Bounds, (UIRectCorner.TopLeft | UIRectCorner.BottomLeft),new SizeF(7,7));
CAShapeLayer maskLayer = new CAShapeLayer();
maskLayer.Frame = this.Layer.Bounds;
maskLayer.BackgroundColor = UIColor.Red.CGColor;
maskLayer.Path = mPath.CGPath;
this.Layer.Mask = maskLayer;

thanks again!!!

App crash when set BackgroundImage in Xamarin.Foms

$
0
0

I creating an app on Xamarin.Forms. When I set background a page by BackgroundImage="background.png" it's crash when load that page on real Android Device (Samsung J7 Prime). But's it work fine on Genymotion and Lumia Phone.
How to fix this!

Hide TabBar on push in Xamarin.Forms

$
0
0

Did anyone manage to implement hiding TabBar on push (iOS)? I found here on forum some examples, but none of them works. I managed to hide TabBar by changing its frame in custom renderer, however ListViews/TableViews have white space in place of TabBar.

Of course I could set Margin="0,0,0,-49", but I'm looking for some generic working solution.

Runtime Permissions

$
0
0

I am working on an Application and just found the need for Runtime Permissions. The problem I have is where to do the checks for them? I have read up on them and I am aware of the Plugin by James Montemagno. However my application uses Xamarin.Forms.Maps which need to be initialized in the MainActivity of the Android project.

This causes an issue where the permissions are required before I can create a dialog for the rationale, I am not into the Xamarin Forms yet. I can create the checks in the activity and the permissions request appears but immediately after the application crashes because permissions aren't granted yet. I can move the application initialization into a check if the permissions are granted but then the app crashes because it cannot load them and it reaches the end of the code.

Is there a way to delay the thread until the permissions are accepted? Also is there a way to show the rationale from within an Activity?

Add TabStrip em iOs using Xamarin Forms

$
0
0

Hello everyone, I'm trying to develop TabStrip in iOs, using Xamarin Forms, using this code from GitHub https://github.com/supersume/XLPagerTabStrip, I was able to translate it to work using Xamarin Forms, but it's not showing the content of the page. Could someone please help me, I do not have much knowledge on iOS.

The sample code is attached.

Mixing Tabbed Pages and Content Pages with Login and Logout

$
0
0

Hi,

I am new to Xamarin (and coding in general, but learning...) and have a question about switching pages.

I have a Login page which is called on Startup This is a ContentPage.

**Login.xaml **

Upon successful login it fires this. I don't want the MainPage to have a "Back" button to go back to the login screen

Login.xaml.cs

MainPage.xaml is a TabbedPage with Navigation

Each of the pages there are all Valid. The Settings page has a Logout button.
**
Settings.xaml**

With the Logout in Settings.xaml.cs doing this

But the end result is that I have the Login screen... with the Tab bar at the bottom

What have I done wrong? I'd like it so when I logout the tabs aren't visible.

Thanks,
Matt


Error when export APK and install this APK file with Xamarin Forms

$
0
0

I have used release mode and debug mode too with Xamarin.forms:

Build-> Archive for Publishing wizard.
After publishing, I selected Ad Hoc and saved the APK to my local drive.

I have min SDK version API level 15 (4.0.3) with target API 23, I have required permission.
I have selected all items from list on Suported ABIs (armeabi, armeabi-v7a, x86, x86_64 and arm64-v8a)
I test with my Nexus 5 with 6.0.1 but I send APK

Always show same error...
(Spanish) Error de análisis
se ha producido un error al analizar el paquete

(English) Parse error
There was a problem parsing the package

I have tested with my custom application and I have generated a sample APK for this library
https://components.xamarin.com/view/zxing.net.mobile.forms

Why?

How change image colors?

$
0
0

Recently I came across the need to build an APP that changes the color of images walls taken from the camera by selecting a color and clicking on the wall
and only the color of the wall in the image would change.
Is there any known api that can help me with this?

Thanks

How to load ToolBar Icon from Byte Array

$
0
0

I want to provide the toolbar icon image from a byte array but ICON property requires a fileimagesource.

I don't know how to do this.
Please help ASAP

The "LinkAssemblies" task failed unexpectedly error while building the application

$
0
0

Hi,

I'm getting the below error while building the application using linking SDK assemblies option and with out shared runtime (as shared run time causing error while release the application.)


Severity Code Description Project File Line Suppression State
Error The "LinkAssemblies" task failed unexpectedly.
Mono.Linker.MarkException: Error processing method: 'System.Void System.Net.Http.HttpClientHandler/c__async0::MoveNext()' in assembly: 'System.Net.Http.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void System.Net.WebHeaderCollection::AddValue(System.String,System.String)
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() D:\Program Files\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 1577

if shared runtime option is unchecked and link option none httpclient.GetStringAsync() method will raise the following error
Method 'System.Net.WebHeaderCollection.AddValue' not found.

but application is working fine when the shared runtime option is ticked and 'SDK assemblies only' link option selected in the android options tab.
I could find lot of similar threads but couldn't find any solution for this one.

Thanks,
Eins

Introduce TEditor(a HTML rich text editor in Xamarin.Forms)

Got "Index was outside the bounds of the array" when use Telerik Chart

$
0
0

my code

    public static List<CategoricalData> GetCategoricalData()
    {
        List<CategoricalData> data = new List<CategoricalData>();
        for (int i = 0; i < 90 ; i++)
        {
            data.Add(new CategoricalData() { Value = 10+i, Category = "" });
        }

        return data;
    }

Chart :

       var chart = new Telerik.XamarinForms.Chart.RadCartesianChart
        {
            VerticalAxis = new Telerik.XamarinForms.Chart.CategoricalAxis(),
            HorizontalAxis = new Telerik.XamarinForms.Chart.NumericalAxis(),
            HeightRequest = 400,
        };

        var series = new Telerik.XamarinForms.Chart.BarSeries();

        series.ItemsSource = GetCategoricalData();

        series.ValueBinding = new Telerik.XamarinForms.Chart.PropertyNameDataPointBinding
        {
            PropertyName = "Value"
        };

        series.CategoryBinding = new Telerik.XamarinForms.Chart.PropertyNameDataPointBinding
        {
            PropertyName = "Category"
        };

        chart.Series.Add(series);

  Frame asd = new Frame ();
      asd.Contect = chart;
      this.Content = asd;

i want display 80 multiline in chart please help me.

Why my emulator doesn't look like a phone?

$
0
0

I been watching tutorials in MVA, but I'm getting bothered, because on the course, his emulator looks like a phone, how can I make mine look like a phone and not look like a forms app. I'm using vs2017 15.3.3, windows 10 pro 1703


Service apk from release = no messages

$
0
0

Hey
I am having an issue with my android Service.
When I am installing the apk from release my Service isn't sending any notifications
but when i start it from debug everything is working just fine...
idk... am i missing sth?
Thanks

ThriveGmbH.BottomNavigationBar.XF

$
0
0

Hi,

I'm using ThriveGmbH.BottomNavigationBar.XF component to display tabs at bottom on Android in order to get native like feeling. Now the problem is, I would like to display some graphic/text beneath the tabs. Please refer to attached image to get the idea what I'm willing to achieve. Any suggestions.

Thanks

Problem with MasterDetailPage

$
0
0

Hello.

I implemented MasterDetailPage into my app, but on Windows 10 the behavior seems a bit weird.
When the app starts, the menu is showing as expected. But when I click an item, it disappears with no way to go back or show the menu again.

It's simple to reproduce.. Download the sample: https://github.com/xamarin/xamarin-forms-samples/tree/master/Navigation/MasterDetailPage
Run the UWP app on Windows 10 and click any menu item. Now you're stuck on that page, with no way to navigate further.

Choose a contact

forms app device.openuri system exception in ios

$
0
0

Hi,

I want to open a browser in iOS with my app with this line of code:

Device.openUri(new Uri("http://www.google.com"));

but when that line executes I get this error:

Could not initialize an instance of the type 'MonoTouch.Foundation.NSUrl': the native 'initWithString:' method returned nil.
It is possible to ignore this condition by setting MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure to false.

Viewing all 77050 articles
Browse latest View live


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