Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android layout 如何设计类似twitter的布局';安卓对推特的回复_Android Layout - Fatal编程技术网

Android layout 如何设计类似twitter的布局';安卓对推特的回复

Android layout 如何设计类似twitter的布局';安卓对推特的回复,android-layout,Android Layout,在我的应用程序I中,当用户单击PostMessageActivity上listview上的某个项目时,它会将他们带到commentActivity,因此我一直在尝试设计一种类似于twitter回复推特活动的布局。在评论端,我有文本视图,显示postmessage和发布该消息的用户的用户名,下面是一个用于显示注释的列表视图,下面是一个文本编辑和一个与文本编辑右侧对齐的Postbutton。我面临的问题是布局不正确,显示消息和用户名的listview在下面的listview上下滚动时仍保持在同一位置

在我的应用程序I中,当用户单击PostMessageActivity上listview上的某个项目时,它会将他们带到commentActivity,因此我一直在尝试设计一种类似于twitter回复推特活动的布局。在评论端,我有文本视图,显示postmessage和发布该消息的用户的用户名,下面是一个用于显示注释的列表视图,下面是一个文本编辑和一个与文本编辑右侧对齐的Postbutton。我面临的问题是布局不正确,显示消息和用户名的listview在下面的listview上下滚动时仍保持在同一位置。我如何使整个内容一起上下滚动

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.machimanapc.howzit.CommentActivity">
<RelativeLayout
    android:id="@+id/header"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:minHeight="?attr/actionBarSize"
    android:background="@color/colorPrimary"
    android:paddingTop="5dp"
    android:paddingBottom="5dp">
    <ImageButton
        android:id="@+id/imgBack"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_action_left_white"
        android:background="?android:selectableItemBackground"
        android:layout_centerInParent="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_marginStart="5dp"
        android:layout_marginLeft="5dp"/>
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/reply"
        android:textColor="@color/textColorPrimary"
        android:layout_centerInParent="true"
        android:textSize="25sp"
        android:layout_marginLeft="5dp"
        android:layout_marginStart="5dp"
        android:layout_centerVertical="true"/>


</RelativeLayout>
<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:id="@+id/content"
    android:layout_marginTop="5dp"
    android:layout_below="@+id/header">
    <TextView
        android:id="@+id/txtUsername_view_Respond"
        android:textColor="@color/colorPrimaryDark"
        android:textStyle="bold"
        android:layout_marginStart="10dp"
        android:layout_marginLeft="10dp"
        android:textSize="6pt"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium" />
    <LinearLayout
        android:id="@+id/stuff"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_below="@+id/txtUsername_view_Respond"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:gravity="end">
        <TextView

            android:id="@+id/txtContent_view_Respond"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:layout_weight="1"
            android:textSize="6pt"
            android:layout_marginLeft="10dp"
            android:layout_marginStart="10dp"
            android:textAppearance="?android:attr/textAppearanceSmall"/>


        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_marginRight="10dp"
            android:layout_marginEnd="10dp"
            android:layout_gravity="end">

            <ImageButton
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="0dp"
                android:src="@drawable/ic_action_up"
                android:background="?android:selectableItemBackground"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:textColor="@color/colorPrimary"
                android:textStyle="bold" />

            <ImageButton
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_action_down"
                android:background="?android:selectableItemBackground"
                />
        </LinearLayout>
    </LinearLayout>
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/stuff">
        <TextView
            android:id="@+id/txtTimestamp_Reply"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginStart="10dp"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:textColor="@color/Timestamp"
            android:textSize="@dimen/feed_item_timestamp"/>


    </RelativeLayout>
</RelativeLayout>
<ListView
    android:id="@+id/posts_list_view"
    android:layout_below="@+id/content"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_marginTop="5dp"
    />
<RelativeLayout
    android:id="@+id/footer"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@color/textColorPrimary"
    android:layout_alignParentBottom="true">

    <EditText
        android:id="@+id/txtEdit_Text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:maxLines="1"
        android:hint="@string/prompt_reply"
        android:layout_marginRight="5dp"
        android:layout_marginEnd="5dp"
        android:layout_marginTop="13dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_toLeftOf="@+id/txtCharacter_count"
        android:layout_toStartOf="@+id/txtCharacter_count"
        android:inputType="textMultiLine"
        android:singleLine="true"/>
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/btnPost"
        android:layout_marginRight="5dp"
        android:layout_marginEnd="5dp"
        android:layout_centerInParent="true"
        android:text="@string/prompt_post"
        android:background="@drawable/newrounded"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true"/>
    <TextView
        android:id="@+id/txtCharacter_count"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toLeftOf="@+id/btnPost"
        android:layout_toStartOf="@+id/btnPost"
        android:layout_marginBottom="@dimen/activity_vertical_margin"
        android:text="@string/character_count_placeholder"
        android:layout_marginRight="5dp"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:gravity="center"
        android:layout_marginTop="25dp"
        android:layout_marginLeft="5dp"
        android:layout_marginStart="5dp"/>
</RelativeLayout>


uum,你不喜欢把你的问题写得有点风格吗?这是完全不可理解的代码/xmlI将尝试。使用我正在使用的电话很难做到这一点。