Giter Site home page Giter Site logo

xamarin.multilinelabel's Introduction

xamarin.multilinelabel's People

Contributors

depechie avatar

Stargazers

 avatar Matija Stepanic avatar Jan Karger ツ ☀ avatar Emanuele Sabetta avatar

Watchers

 avatar James Cloos avatar

xamarin.multilinelabel's Issues

The Label breaking with character - in Redmi Note 4 device

I'm trying to display a label in my Redmi not Device.I'm doing it in xamarin forms. But the word is breaking with - at the end. I want the whole word to be displayed in next line instead of breaking the word. For example

Welcome to Lighthouse, the PSAV online customer followup prog-

ram designed to ensure a one-on-one approach to individual guest contact and interaction. Lo-

gin using your PSAV credentials to begin entering your guests' Touch Points now.

It should be:

Welcome to Lighthouse, the PSAV online customer followup

program designed to ensure a one-on-one approach to individual guest contact and interaction.

Login using your PSAV credentials to begin entering your guests' Touch Points now.

But this is not shown in any other device rather than Redmi Note 4. I have tried all LineBreakMode properties but nothing helps. This is my code

<Label Grid.Row="0" Grid.Column="0" Style="{StaticResource LabelStyle}" Margin="10" x:Name="lblLogin" TextColor="Black" Text="{Binding lblLoginText , Mode=TwoWay}" > </Label>

I know i can use &#x0a; with the word which breaks and it will take that word to next line. But that is like hard coding a break line.I want it to be done dynamically.

Please help me with this.Ur help will be appreciated.If this is not possible in Xamarin Forms please provide me a proof for that please.

TailTruncation when the label meets the limit of word wrap space inside label bounds

This is very useful, because by default Xamarin.Forms the TailTruncation mode for labels works fine only for single lines of text.

We can now force the TailTruncation to happen at the 2nd or 3rd or Nth line, if we know in advance the lenght of the text, using your MultilineLabel custom renderer .

But what I really need is a TailTruncation that works even when I don't know in advance how many lines of text will fit in a label.

If the height of my Label changes, and so the number of lines of text that can fit in it, I want the TailTruncation happens at the end of the available space. Not at the line before and neither at the line after.

How can I get TailTruncation happens when the text meets the limit of the available word wrap space inside the Label bounds?

Is there a custom renderer trick that allows to calculate the number of lines that fit inside the bounds and set the TailTruncation line number accordingly (on both iOS and Android)?

Thanks in advance.

How to get the mac address of BLE device in code behind in Xamarin forms?

I'm connecting my Bluetooth BLE device in background. So I need to get the Bluetooth mac address in my code behind just like how we are displaying the mac address in our XAML.

ListView x:Name="lv" ItemSelected="lv_ItemSelected" BackgroundColor="White" SeparatorColor="Aqua"> 
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <StackLayout>
                                <Label TextColor="Black" Text="{Binding NativeDevice.Address}"/>
                                <Label TextColor="Black" Text="{Binding NativeDevice.Name}"/>
                            </StackLayout>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>

so in our xaml I'm able to get the mac address in NativeDevice.Address. So same way I need to get it in my xaml.cs. I am able to get the mac address by following this approach

var vailditems = adapter.DiscoveredDevices.Where(i => i.NativeDevice.ToString()
But this is not good approach I need to get the mac address in NativeDevice.Address just like my xaml. I tried this approach but it is giving the address as null.

public class NativeDevice
        {
            
            public string Name { get; set; }
            public string Address { get; set; }
        }
NativeDevice V = new NativeDevice();

                    Baddress = V.Address;

For your information the mac address is accessible in IDevice interface which is predefined. So in the IDevice interface I need to access the object NativeDevice. This is the interface.

public interface IDevice : IDisposable
{
   
    Guid Id { get; }
   
    string Name { get; }
   
    int Rssi { get; }
   
    object NativeDevice { get; }
   
    DeviceState State { get; }
    
    IList<AdvertisementRecord> AdvertisementRecords { get; }

    
   
    Task<IService> GetServiceAsync(Guid id, CancellationToken cancellationToken = default);
    
    Task<IList<IService>> GetServicesAsync(CancellationToken cancellationToken = default);
   
    Task<bool> UpdateRssiAsync();
}

So I need to access the interface and get the NativeDevice.address in code behind. And I will be removing the XAML part so I don't need the mac address from itemsource of ListView aswell. I don't have any clue regarding this. Any suggestions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.