0
我正在开发一个具有操作栏的Android应用程序。我知道如何以像素为单位设置动作条的高度,但我想将动作条的高度设置为屏幕高度的15%。那可能吗?以下是我在我的资源文件至今:Android - 将行动栏高度设置为总高度的一小部分
<!-- Application theme. -->
<style name="CustomActionBarTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
<item name="android:windowActionBarOverlay">true</item>
<item name="android:actionBarStyle">@style/Widget.Styled.ActionBar</item>
</style>
<style name="Widget.Styled.ActionBar"
parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:displayOptions">showHome|useLogo</item>
<item name="android:background">@color/white</item>
<item name="android:height">90dp</item>
</style>
你无法单独使用XML。您可以通过编写自定义视图来完成。 – Karakuri 2015-02-12 07:33:39
使用工具栏代替,,,,, – IshRoid 2015-02-12 08:30:06
@Ishrat - 我相信工具栏只能使用最新的Android API,并且我不想限制我的应用程序,但它可能是一个很好的解决方案。 – user3623874 2015-02-12 12:07:14