<Button

        android:id="@+id/reset"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_below="@+id/maxAcceleration"

        android:layout_centerHorizontal="true"

        android:layout_marginTop="80dp"

        android:gravity="center"

        android:text="@string/reset"

        android:textSize="32sp" />


It's a button.


Thanks

On Sun, Jan 8, 2012 at 3:45 PM, skink <[email protected]> wrote:

>
>
> Raghav Sood wrote:
> > There's nothing unclear, but according to the docs, the Button inherits
> the
> > setTypeface() from the TextView and it should work. However, I get this
> > exception when using it.
> >
> > Even the similar questions on StackOverflow on setting the font of the
> > Button say to use setTypeface(). It doesn't seem to be working though.
> >
> > I set it like this:
> >
> >         typeFace1 = Typeface.createFromAsset(getAssets(), "fonta.ttf");
> >
> >         final Button button = (Button) findViewById(R.id.reset);
> >
> >         button.setTypeface(typeFace1);
> >
> >
> > Any idea on how I could set the typeface of the button?
> >
> >
> > Thanks
> >
> > On Sun, Jan 8, 2012 at 3:35 PM, skink <[email protected]> wrote:
> >
> > > what's unclear in that stack trace?
> > >
> > > java.lang.ClassCastException:
> > > android.widget.TextView cannot be
> > > cast to
> > > android.widget.Button
> > >
> > > pskink
> > >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to
> [email protected]
> > > To unsubscribe from this group, send email to
> > > [email protected]
> > > For more options, visit this group at
> > > http://groups.google.com/group/android-developers?hl=en
> >
> >
> >
> >
> > --
> > Raghav Sood
> > http://www.androidactivist.org/ - Author
> > http://www.appaholics.in/ - Founder
>
> what is R.ud.reset?  paste layout xml
>
> pskink
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Raghav Sood
http://www.androidactivist.org/ - Author
http://www.appaholics.in/ - Founder

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to