これは、このiOS の質問に相当する Android です。
画面の約 20% (ActionBar の下...) に MapView を含むビューを作成しようとしています。画面の残りの部分は、下にスクロールすると MapView の上に重なって非表示になる ScrollView です。要するに、FourSquare の Android アプリのようなものです。何か案は?
これは、このiOS の質問に相当する Android です。
画面の約 20% (ActionBar の下...) に MapView を含むビューを作成しようとしています。画面の残りの部分は、下にスクロールすると MapView の上に重なって非表示になる ScrollView です。要するに、FourSquare の Android アプリのようなものです。何か案は?
AndroidSlidingUpPanelに基づく実装を作成しました(このプロジェクトに感謝します)。
詳細http://android.amberfog.com/?p=915 サンプル付きソースコード: https://github.com/dlukashev/AndroidSlidingUpPanel-foursquare-map-demo
最も簡単な解決策は、スライダー コンテンツ (SlidingUpPanel の 2 番目のパラメーター) にマージンを追加してから、フェード バックグラウンドを削除することです。すべて XML から実行されます。
xml ファイルで、 aScrollView
を埋め込む a LinearLayout
、 a を埋め込む a を宣言するだけMapView
です。
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:fillViewport="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
...... Your list and other stuff .......
</LinearLayout>
</LinearLayout>
</ScrollView>
layout_weight
次に、属性を指定して各要素のサイズを設定できます
EDIT IvanDanDo、私たちの議論の後、私はあなたが望むことをするかもしれないこのリンクを見つけました(確かではありませんが、私はそれを試しませんでした):Android:ソフトウェアキーボードのように別のビューの下に任意のビュースライドを持ってください