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 回答