在我的应用中,Icon将动态加载并自动适合图标插槽。目前,图标未调整大小,因此它会扩展ActionBar
的高度。我使用的是SupportActionBar
而不是ToolBar
,因为我刚刚从Activity
迁移到AppCompatActivity
,并希望尽可能多地重用。如何在ActionBar
上自动调整图标?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root_view_second_screen"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="?wallpaper"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
tools:context="com.sarkms.cclib.SecondScreen" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ListView
android:id="@+id/convView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@android:color/transparent"
android:dividerHeight="10.0sp"
android:transcriptMode="normal"
android:smoothScrollbar="true" >
</ListView>
<TextView
android:id="@+id/lbl_MultiContactsPing_note"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:padding="10dp"
android:background="@drawable/lightblue_rounded_poll_title_bg"
android:visibility="gone"
android:text="@string/lbl_multiplecontacts_ping_note"
android:textSize="20sp"
android:textStyle="italic"
android:textColor="@color/grey_dark" />
</RelativeLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15sp"
android:layout_marginBottom="15sp" >
<ImageView
android:id="@+id/emoticon_btn"
android:layout_width="30sp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:src="@drawable/smiley" />
<ImageView
android:id="@+id/impMsg"
android:layout_width="12dp"
android:layout_height="25dp"
android:layout_gravity="bottom"
android:padding="4dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@drawable/imp_msg_unselected_5" />
<ImageView
android:id="@+id/Send"
android:src="@drawable/sendping_7"
android:layout_width="35sp"
android:layout_height="wrap_content"
android:layout_marginLeft="15sp"
android:layout_marginRight="15sp"
android:layout_gravity="bottom" />
</LinearLayout>