-1
好吧,我一直花費數小時試圖解決這個問題,甚至在網上找到解決方案,到目前爲止沒有任何工作。如何讓TextView「content_note」填充此LinearLayout中的可用空間?如何讓textview填充線性佈局的高度?
<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" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:gravity="center"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"
android:background="#000000"
android:id="@+id/screen">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/size"
android:layout_alignParentBottom="true"
android:alpha=".0" />
<HorizontalScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/horizontalScrollView"
android:layout_alignBottom="@+id/current"
android:background="@drawable/wood_background"
android:layout_alignParentStart="true">
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/recent_notes_list">
</LinearLayout>
</HorizontalScrollView>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/gen_note"
android:id="@+id/current"
android:singleLine="false"
android:textStyle="bold|italic"
android:typeface="sans"
android:alpha=".75"
android:gravity="center_vertical"
android:layout_alignParentEnd="false"
android:layout_alignParentStart="true"
android:layout_alignParentTop="false"
android:layout_marginLeft="16dp"
android:layout_alignParentBottom="false"
android:layout_alignParentLeft="false"
android:layout_alignParentRight="false"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp" />
<Button
android:layout_width="35sp"
android:layout_height="fill_parent"
android:text="@string/previous_txt"
android:id="@+id/previous"
android:layout_alignParentStart="false"
android:layout_below="@+id/horizontalScrollView"
android:textSize="30sp"
android:textStyle="bold"
android:layout_alignParentLeft="false"
android:layout_alignParentEnd="false"
android:alpha=".5"
android:layout_above="@+id/settings" />
<Button
android:layout_width="35sp"
android:layout_height="fill_parent"
android:text="@string/next_button"
android:id="@+id/next"
android:layout_alignParentStart="false"
android:layout_below="@+id/horizontalScrollView"
android:textSize="30sp"
android:textStyle="bold"
android:layout_alignParentLeft="false"
android:layout_alignParentEnd="false"
android:alpha=".5"
android:singleLine="false"
android:layout_alignParentRight="true"
android:layout_alignBottom="@+id/note_frame"
android:layout_above="@+id/settings" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/anim_frame_right"
android:orientation="vertical"
android:layout_toLeftOf="@+id/next"
android:layout_toRightOf="@+id/previous"
android:layout_below="@+id/horizontalScrollView"
android:layout_alignBottom="@+id/previous"
android:background="#FFFFFF"
android:visibility="gone">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/anim_right_note">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/title_right"
android:text="TITLE"
android:textSize="30sp"
android:gravity="center_vertical|center|center_horizontal"
android:textStyle="bold"
android:textColor="#000000" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/content_right"
android:text="Content"
android:layout_marginLeft="15sp"
android:layout_marginRight="10sp"
android:textColor="#000000" />
</LinearLayout>
</ScrollView>
<ImageButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/anim_right_foreground"
android:contentDescription="@string/app_name"
android:visibility="invisible" />
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/anim_frame_left"
android:layout_toLeftOf="@+id/next"
android:layout_toRightOf="@+id/previous"
android:layout_below="@+id/horizontalScrollView"
android:layout_alignBottom="@+id/previous"
android:visibility="gone"
android:background="#FFFFFF">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/anim_left_note">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/title_left"
android:text="TITLE"
android:textColor="#000000"
android:gravity="center_vertical|center|center_horizontal"
android:textSize="30sp"
android:textStyle="bold" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/content_left"
android:layout_marginLeft="15sp"
android:layout_marginRight="10sp"
android:text="Content"
android:textColor="#000000" />
</LinearLayout>
</ScrollView>
<ImageButton
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/anim_left_foreground"
android:visibility="invisible"
android:layout_alignLeft="@+id/anim_frame_left"
android:layout_alignRight="@+id/anim_frame_left"
android:layout_alignBottom="@+id/anim_frame_left"
android:layout_alignTop="@+id/previous" />
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/note_frame"
android:orientation="vertical"
android:layout_toLeftOf="@+id/next"
android:layout_toRightOf="@+id/previous"
android:layout_below="@+id/horizontalScrollView"
android:layout_alignBottom="@+id/previous"
android:visibility="visible"
android:background="#FFFFFF">
<ScrollView
android:layout_width="match_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/note_view"
android:baselineAligned="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="10"
android:orientation="vertical"
android:gravity="fill_vertical">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/title_note"
android:text="TITLE"
android:textSize="30sp"
android:gravity="center_vertical|center|center_horizontal"
android:textStyle="bold"
android:textColor="#000000"
android:layout_weight="9" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/title_note_text"
android:text="TITLE"
android:textSize="30sp"
android:gravity="center_vertical|center|center_horizontal"
android:textStyle="bold"
android:textColor="#000000"
android:visibility="gone"
android:layout_weight="9" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/content_note"
android:text="Content_note"
android:layout_marginLeft="15sp"
android:layout_marginRight="10sp"
android:textColor="#000000"
android:alpha="1"
android:layout_gravity="top|left|bottom|right"
android:layout_weight="1" />
<EditText
android:layout_width="fill_parent"
android:layout_height="337dp"
android:id="@+id/content_note_text"
android:layout_marginLeft="15sp"
android:layout_marginRight="10sp"
android:textColor="#000000"
android:alpha="1"
android:visibility="gone"
android:layout_weight="1" />
</LinearLayout>
</ScrollView>
<ImageButton
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/foreground"
android:contentDescription="@string/app_name"
android:visibility="gone" />
</FrameLayout>
<ImageButton
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:id="@+id/settings"
android:layout_alignParentEnd="false"
android:layout_alignParentStart="false"
android:layout_alignParentBottom="true"
android:layout_alignTop="@+id/size"
android:clickable="true"
android:alpha=".65"
android:layout_below="@+id/size"
android:layout_alignLeft="@+id/size"
android:layout_alignRight="@+id/previous"
android:src="@android:drawable/ic_menu_preferences"
android:contentDescription="settings"
android:padding="60dp"
android:textAlignment="center"
android:cropToPadding="false"
android:adjustViewBounds="false" />
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="false"
android:src="@android:drawable/ic_input_add"
android:text="+ New Note"
android:id="@+id/new_note"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@+id/settings"
android:layout_alignParentEnd="false"
android:layout_alignTop="@+id/size"
android:clickable="true"
android:layout_toLeftOf="@+id/delete"
android:alpha=".65" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/delete"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/settings"
android:src="@android:drawable/ic_menu_delete"
android:alpha=".65"
android:contentDescription="@string/delete" />
請說明您想設置爲全寬/高的文本視圖 –
ID爲「Content_note」的人 –