1. 程式人生 > >No orientation specified, and the default is horizontal.

No orientation specified, and the default is horizontal.



整的錯誤提示資訊為:No orientation specified, and the default is horizontal. This is a common source of bugs when

 children are added dynamically.

通常發生這個錯誤提示的原因是我們直接在原有的頁面上把別的佈局標籤改成<LinearLayout>,但是使用<LinearLayout>標籤要指明方向,水平方向還是垂直方向

horizontal or vertical

所以直接修改,會導致沒有指名線性佈局的方向,只要新增上

 android:orientation = "vertical"

 android:orientation = "horizontal"

即可解決