Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 有风格的线性布局,没有方向问题?_Android_Android Linearlayout_Android Styles - Fatal编程技术网

Android 有风格的线性布局,没有方向问题?

Android 有风格的线性布局,没有方向问题?,android,android-linearlayout,android-styles,Android,Android Linearlayout,Android Styles,我有线性布局的风格: <style name="clickable_zone"> <item name="android:layout_height">match_parent</item> <item name="android:layout_width">match_parent</item> <item name="android:id">@+id/click_zone</item>

我有
线性布局的风格

<style name="clickable_zone">
    <item name="android:layout_height">match_parent</item>
    <item name="android:layout_width">match_parent</item>
    <item name="android:id">@+id/click_zone</item>
    <item name="android:background">@drawable/simple_button_holo</item>
    <item name="android:orientation">horizontal</item>
</style>

你不能在style.xml中省略方向吗?当然可以,但这是禁用警告…我不知道如何解决这个问题,如果我添加你的自定义样式并将其添加到线性布局中,我不会得到任何警告。。。你能提供更多的信息吗?警告说什么?@Kevin,请看UPD1(第一篇帖子)。Сurious,我错了,在整个eclipse中禁用了这个问题(不仅仅是文件或项目)。现在我不知道如何重新设置这个警告…这个消息是不言自明的。
<LinearLayout
        style="@style/clickable_zone" />
Checks that LinearLayouts with multiple children set the orientation

The default orientation of a LinearLayout is horizontal. It's pretty easy to believe that the layout is vertical, add multiple children to it, and wonder why only the first child is visible (when the subsequent children are off screen to the right). This lint rule helps pinpoint this issue by warning whenever a LinearLayout is used with an implicit orientation and multiple children.

It also checks for empty LinearLayouts without an orientation attribute that also defines an id attribute. This catches the scenarios where children will be added to the LinearLayout dynamically.