Answer the question
In order to leave comments, you need to log in
Is it possible to write your own text to the right of the name of the program in Android?
I don't know exactly what it's called, but probably ActionBar
Where AndroidBattery is written :
Is it possible to display your text to the right of the program name?
Answer the question
In order to leave comments, you need to log in
We continue yesterday's relay?) Activity#setTitle("AndroidBattery: Some text")
as an option.
Or for example
<activity
android:name=".ui.activity.AboutActivity"
android:label="AndroidBattery: Some text"
android:parentActivityName=".ui.activity.HomeActivity" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.Toolbar.Title"
/>
<TextView
android:id="@+id/additional_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.Toolbar.SubTitle"
/>
</LinearLayout>
protected Toolbar mToolbar;
protected TextView mToolbarTitle;
protected TextView mToolbarSubTitle;
...
View statusContainer = LayoutInflater.from(this).inflate(R.layout.actionbar_status, mToolbar, false);
ActionBar.LayoutParams lp = new ActionBar.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
mToolbar.addView(statusContainer, lp);
mToolbarTitle = (TextView) statusContainer.findViewById(R.id.title);
mToolbarSubTitle = (TextView) statusContainer.findViewById(R.id.subTitle);
mToolbarTitle.setText("Какой-то заголовок");
mToolbarSubTitle.setText("Какой-то дополнительный текст");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question