Nếu bạn chỉ cần kích thước biểu tượng để thiết lập kích thước của một thành phần xem bạn có thể sử dụng thanh công cụ .Button.Navigation style. Dưới đây là ví dụ tôi tạo chế độ xem biểu tượng điều hướng giả.
<android.support.design.widget.CoordinatorLayout
android:id="@+id/vCoordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--CONTENT VIEW-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
<!--FAKE TOOLBAR NAVIGATION ICON-->
<RelativeLayout
android:layout_width="?attr/actionBarSize"
android:layout_height="?attr/actionBarSize">
<ImageView
android:id="@+id/vToolbarNavigationIcon"
style="@style/Widget.AppCompat.Toolbar.Button.Navigation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/my_icon"/>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
Nguồn
2016-09-07 19:35:09
http://www.google.co.uk/design/spec/layout/metrics-keylines.html#metrics-keylines-keylines-spacing – zaingz
tôi có thể tính toán kích thước bản vẽ (đó là 40 x 40dp), nhưng kích thước nội dung là gì? Lưu ý rằng các biểu tượng ngăn điều hướng nhỏ hơn "biểu tượng hình đại diện". – thiagolr
Có cách nào để chỉnh sửa kích thước biểu tượng ngăn điều hướng mặc định không? – Taslim