Forum Xamarin.Android

More and less if the texview is bigger than max count lines

I would like to ask how can I change my code.
`listOfTexts.Add (eventText);
listOfTexts.Add (quoteText);
listOfTexts.Add (wordText);
listOfTexts.Add (articleText);
listOfTexts.Add (thoughtText);

        foreach (var tv in listOfTexts) {

            Java.Lang.Runnable mUpdateGeneration = new Java.Lang.Runnable(() =>
                    if(tv.LineCount > MAX_LINE){
                        myButton = new Button(this);
                        myButton.Text = "more..." + tv.Id;
                        //RelativeLayout.LayoutParams textParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WrapContent, RelativeLayout.LayoutParams.WrapContent);

                        myButton.Click += (object sender, EventArgs e) => {
                                myButton.Text = "less...";


                        //myButton.LayoutParameters = textParams;

            tv.Post (mUpdateGeneration);`

I want to do something like

Thank you

Sign In or Register to comment.