如何修复切断的自定义搜索查看后台景观? [英] How to fix cut-off custom SearchView background in landscape?

查看:196
本文介绍了如何修复切断的自定义搜索查看后台景观?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经遵循这个伟大的答案<一href="http://stackoverflow.com/questions/11085308/changing-the-background-drawable-of-the-searchview-widget">question让搜索查看插件在我的动作条适合自定义主题。它工作得很好肖像模式,但在景观操作系统将收缩动作条的高度,以最大限度地提高内容的屏幕房地产。相反,没有利润到动作条就像其他项目拟合搜索查看小部件,它在顶部砍掉了:

I've followed the great answer for this question to make the SearchView widget in my ActionBar fit a custom theme. It works just fine for portrait mode, but in landscape the OS will shrink the height of the ActionBar to maximize content screen estate. Instead of fitting the SearchView widget without margins into the ActionBar just like the other items, it is chopped off at the top:

我已经通过Android源的资源文件夹中挖出,但找不到任何专门的版面或资源,这将使明显如何解决这一问题或Android本身甚至如何管理,以适应默认的Holo 搜索查看构件到降低动作条。

I've dug through the res-folder of the Android source, but could not find any specialized layouts or resources that would make obvious how to fix this or even how Android itself manages to fit the default Holo SearchView Widget into the reduced ActionBar.

任何见解是AP preciated。 THX。

Any insights are appreciated. THX.

推荐答案

您必须使用编辑文本的缩小版。该可绘制禀尺寸比默认编辑文本可绘制更小。

You have to use a smaller version of the edit text. The drawables instrinsic dimensions are smaller than the default edit text drawables.

看看这里使用的可绘

<一个href="http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android/4.3_r2.1/frameworks/support/v7/appcompat/res/drawable/abc_textfield_searchview_holo_dark.xml?av=f" rel="nofollow">http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android/4.3_r2.1/frameworks/support/v7/appcompat/res/drawable/abc_textfield_searchview_holo_dark.xml?av=f

这篇关于如何修复切断的自定义搜索查看后台景观?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆