3

I'm building a camera application where I want to implement the same feature android has in their settings menu:

this is the camera scene settings in portrait mode:

camera scene settings in portrait mode

this is the camera scene settings in landscape mode:

camera scene settings in landscape mode

the orientation of the list and the button changes but the application isn't recreated I guess this happens with a orientationEventListener I managed to rotate the buttons with a rotation animation this way but not the settings list... Any help will be greatly appreciated. Thanks!

4

2 に答える 2

0

カメラの XML を作成するときは、相対レイアウトのみを使用します。さまざまなアイテムのリストビューを含む別のレイアウトを作成します。次に、Javaファイルで、list.xmlをcamerapreview.xmlにiflateします..それは私のワークアウトで機能しました。

于 2012-08-16T12:47:33.463 に答える
0

実際に方向を変更しない場合は、リストとは反対方向に回転するものが必要になります (ギャラリーや水平スクロールビューのような水平方向)。リストを削除してスクロールビューに変更することをお勧めします。回転が変更されたら、水平スクロール ビューに変更し、各アイテムを 90 度回転させます。正しい位置などに配置するには少しハッキングが必要かもしれませんが、最も簡単な解決策かもしれません.

于 2012-08-16T14:08:46.067 に答える