安卓开发怎么用自己的toolbar

2025-04-09 01:19:29
推荐回答(1个)
回答1:

首先在res/layout下面建一个xml,里面定义好菜单栏,这个不要求放到最下面,作为参考,可以看看这个:
再定义一个引用:
android:layout_height="fill_parent"
android:orientation="horizontal"
android:gravity="bottom">


如果情况复杂一点,用到了ScollView,那就用一个RaleativeLayout套在外面,把Toolbar放在最下面,为了防止软键盘把他顶上去,还要在Activity里面加上属性;android:windowSoftInputMode="adjustPan"