I need to develop a button that has two label in.
I find some good articles about custom views, but I can\'t imagine that how can I create a myButton Class(with cus
You can create a custom view. I have used Layout as a button by setting custom button style to the layout and have added two textViews to it, this way:
and in Activity you can have this to set different typeface:
Typeface font=Typeface.createFromAsset(getAssets(),"ARIALN.TTF") ;
Typeface font2=Typeface.createFromAsset(getAssets(), "COMPCTAN.TTF");
TextView firstTextView = (TextView)findViewById(R.id.firstTextView);
TextView secondTextView = (TextView)findViewById(R.id.secondTextView);
firstTextView.setTypeface(font);
secondTextView.setTypeface(font2);
LinearLayout btnLayout=(LinearLayout) findViewById(R.id.customButtonLayout);
btnLayout.setOnClickListener(this);