0

私はそれがどのように見えるか写真の詳細ビューを参照しています

Google+ header
---------
Photo
transparent background meta data (user, description, etc)
comments
---------
Add comment text input that is always on screen bottom

写真、透明な背景のメタデータ、コメントはすべてスクロールしますが、コメントの追加テキスト入力は画面の下部に固定されたままです。 
これは、実行時に写真のサイズが設定されているListView特別なズーム機能を備えたものですか?ImageView

4

1 に答える 1

3

これは、RelativeLayoutを使用して行われます。RelativeLayout内では、ビューを好きな場所に配置できます。この場合、Google Plusヘッダーを保護者の上部に貼り付け、コメントバーを保護者の下部に貼り付けます。この両方のビューの間に、画像、メタタグ、写真へのコメントを含むScrollViewを配置します。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView 
    android:id="@+id/actionbar"
    android:layout_width="fill_parent"
    android:layout_height="50dp"
    android:layout_alignParentTop="true"
    android:textSize="20dp"
    android:text="Google Plus ActionBar" />
<TextView 
    android:id="@+id/commentbar"
    android:layout_width="fill_parent"
    android:layout_height="50dp"
    android:layout_alignParentBottom="true"
    android:textSize="20dp"
    android:text="Add Comment Bar" />
<ScrollView 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_below="@id/actionbar"
    android:layout_above="@id/commentbar">
    <LinearLayout 
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <FrameLayout 
            android:layout_width="fill_parent"
            android:layout_height="500dp"
            android:background="#00ff00" />
        <FrameLayout 
            android:layout_width="fill_parent"
            android:layout_height="50dp"
            android:background="#0000ff" />
        <FrameLayout 
            android:layout_width="fill_parent"
            android:layout_height="50dp"
            android:background="#ff0000" />
    </LinearLayout>
</ScrollView>

結果(緑のビューは画像を表し、青と赤のビューはコメントを表す必要があります): ここに画像の説明を入力してください

于 2011-08-24T11:37:28.090 に答える