TextView Marquee is not working in linearlayout

66 Views Asked by At

Unfortunately, I cannot deal with this problem. More precisely, the marque function does not work for me after adding a TextView to LinearLayout. If I just add a TextView to the view, it works fine. What could be the problem? Perhaps a problem with the LinearLayout itself? Problem with txv_appointment. My code:

private void Calendar_InlineItemLoaded(object sender, InlineItemLoadedEventArgs e)
    {
        calendar_item = e.Date;
        appointment = e.CalendarInlineEvent;

        ContextThemeWrapper newContext = new ContextThemeWrapper(this, Resource.Style.textView_appointment);
        txv_appointment = new TextView(newContext);

        txv_appointment.Text = appointment.Subject;
        if (tablet == true) { txv_appointment.TextSize = 24; }
        else { txv_appointment.TextSize = 14; }            
        txv_appointment.SetSingleLine(true);
        txv_appointment.Ellipsize = Android.Text.TextUtils.TruncateAt.Marquee;
        txv_appointment.SetMarqueeRepeatLimit(10);
        txv_appointment.Focusable = true;
        txv_appointment.FocusableInTouchMode = true;
        txv_appointment.SetHorizontallyScrolling(true);
        txv_appointment.Selected = true;
        if (theme == 0) { txv_appointment.SetTextColor(Color.White); } else { txv_appointment.SetTextColor(Color.Black); }
        //e.View = txv_appointment;

        LinearLayout ll1 = new LinearLayout(this);
        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent);
        ll1.LayoutParameters = lp;
        ll1.Orientation = Orientation.Vertical;
        ll1.AddView(txv_appointment);

        LinearLayout.LayoutParams lp_textView2 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
        TextView txtView2 = new TextView(newContext);
        txtView2.LayoutParameters = lp_textView2;
        txtView2.Text = AppResources.ResourceManager.GetString("str_click");
        ll1.AddView(txtView2);
        e.View = ll1;
    }
0

There are 0 best solutions below