Sunday, 25 August 2013

ScrollView, LinearLayout chaos

ScrollView, LinearLayout chaos

I today added a scrollview to my app. I wanted something like google now
cards. It worked, but I want it to be fullscreen, but on the bottom. On
the bottom i got a EditText and a Button and i want the scrollview to stop
there, so that they are both visible. How can i do that? :s That's my
activity:
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/chat_layout"
android:icon="@drawable/ic_linkrholoorange"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".Chat"
android:text = "Now">
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<com.linkr.chat.NowLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#e3e3e3"
android:orientation="vertical">
<TextView
android:id="@+id/card"
style="@style/nowCardStyle"
android:layout_width="match_parent"
android:layout_height="100dp"
tools:context=".Chat"
android:layout_alignTop="@+id/linearLayout"
android:layout_alignLeft="@+id/linearLayout"/>
</com.linkr.chat.NowLayout>
</ScrollView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="10dp"
android:id="@+id/linearLayout">
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:ems="10"
android:id="@+id/chatTextArea"
android:layout_alignTop="@+id/sendButton"
android:layout_toLeftOf="@+id/sendButton"
android:layout_alignBottom="@+id/sendButton"
android:layout_alignLeft="@+id/scrollView"
android:enabled="false"
android:focusable="false"
android:hint="What's on your mind..."
android:visibility="visible"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/sendButton"
android:gravity="bottom"
android:background="@drawable/social_send_now"
android:onClick="sendMethod"
android:layout_alignBottom="@+id/scrollView"
android:layout_alignRight="@+id/scrollView"/>
</LinearLayout>
</RelativeLayout>
<!-- The navigation drawer -->
<!--<ImageView
android:id="@+id/drawerimage"
android:layout_width="320dp"
android:layout_height="100dp"
android:layout_gravity="start"
android:background="@drawable/desert"
android:choiceMode="singleChoice"></ImageView>-->
<ListView
android:id="@+id/drawer"
android:layout_width="320dp"
android:layout_height="match_parent"
android:background="#F3F3F4"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:hint="What's on your mind?"
android:divider="@android:color/darker_gray"
android:dividerHeight="1dp" ></ListView>
</android.support.v4.widget.DrawerLayout>
I hope you can help me Thanks a lot!

No comments:

Post a Comment