App Bar

袁旻
2023-12-01

——Developer


values-v14

res下文件夹values-14 values-21

Develop > Reference > R.attr displayOptions

Options affecting how the action bar is displayed.

Must be one or more (separated by “|”) of the following constant values.

ConstantValue
none0
useLogo0x1
showHome0x2
homeAsUp0x4
showTitle0x8
showCustom0x10
disableHome0x20

Develop > Training > Adding the App Bar

app bar的主要作用(key function)

  1. A dedicated space for giving your app an identity and indicating the user’s location in the app.

  2. Access to important actions in a predictable way, such as search.

  3. Support for navigation and view switching(with tabs or drop-down lists

#

how to use the v7 appcompat support library’s Toolbar widget as an app bar.

other ways to implement an app bar
ActionBar as an app bar.
如果是Action Bar,去掉阴影,在Activity onCreate()中加上

    getSupportActionBar().setElevation(0f);

1. Setting Up the App Bar

Add a Toolbar to an Activity
- Add the v7 appcompat support library to your project
- Make sure the activity extends AppCompatActivity

public class MyActivity extends AppCompatActivity {
}

啊呀,写不下去了,其实也看不下去了。
官方文档好的多,go

 类似资料: