Ich möchte das Logo in der Mitte der Aktionsleiste anzeigen. Hier ist mein Layout-Code: Der folgende Code sollte funktionieren, aber warum nicht? Bitte helfen Sie mirWie Logo in der Mitte der Actionbar Symbolleiste in Android platzieren?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/logo"
android:layout_gravity="center"
/>
</LinearLayout>
Und im onCreate()
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
getSupportActionBar().setCustomView(R.layout.custom_logo);
http://stackoverflow.com/questions/32857438/center-position-of-logo-in-action-bar-android – USKMobility
Ich habe versucht, auf diesen Link, aber es funktionierte nicht für mich arbeiten –
mein Logo nicht –