我现在的问题:
我需要将这两个按钮“附加”到底部 - 我不希望它们可以滚动(仅在底部 - 始终可见)。但我的Edittext需要可滚动,因为文本很长。在android studio中它看起来不错,但在APP中没有。
XML
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardBackgroundColor="#212121"
app:cardCornerRadius="8dp"
app:cardElevation="5dp"
app:cardMaxElevation="0dp"
app:cardPreventCornerOverlap="false"
app:cardUseCompatPadding="true">
<EditText
android:id="@+id/storyTextView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/choiceButton1"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="@null"
android:cursorVisible="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:lineSpacingMultiplier="1.2"
android:paddingBottom="15dp"
android:paddingLeft="18dp"
android:paddingRight="18dp"
android:paddingTop="15dp"
android:text="You continue your course to Earth. Two days later, you receive a transmission from HQ saying that they have detected some sort of anomaly on the surface of Mars near an abandoned rover. They ask you to investigate, but ultimately the decision is yours because your mission has already run much longer than planned and supplies are low."
android:textColor="#9E9E9E"
android:textSize="16sp"
/>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="#212121"
app:cardCornerRadius="8dp"
app:cardElevation="5dp"
app:cardMaxElevation="0dp"
app:cardPreventCornerOverlap="false"
app:cardUseCompatPadding="true">
<Button
android:id="@+id/choiceButton1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="1dp"
android:background="@null"
android:text="CONTINUE HOME TO EARTH"
android:textColor="#b71c1c"/>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="#212121"
app:cardCornerRadius="8dp"
app:cardElevation="5dp"
app:cardMaxElevation="0dp"
app:cardPreventCornerOverlap="false"
app:cardUseCompatPadding="true">
<Button
android:id="@+id/choiceButton2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="1dp"
android:background="@null"
android:text="STOP AND INVESTIGATE"
android:textColor="#b71c1c"/>
</android.support.v7.widget.CardView>
一切都在:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_story"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:orientation="vertical"
tools:context="com.project.StoryActivity">
</LinearLayout>
IN APP - CLICK - 可滚动,但“不适合”
我希望你理解我的问题,谢谢你们:)
答案 0 :(得分:0)
首先,您不需要将cardView用于图像中显示的布局(使用相对布局)。 要使用cardView, (screen shot is shown here) 你应该添加 编译&#39; com.android.support:cardview-v7:25.0.1&#39; to build.gradle(Module:app)文件 cardElevation将为获得影子留出余量。
in xml,
echo $uploads_base_url=$_SESSION["uploads_base_url"];
答案 1 :(得分:0)
使用RelativeLayout而不是LinearLayout。
到底部按钮,
android:layout_alignParentBottom="true"
第二个按钮
android:layout_above="@+id/bottom_button"
使EditText可滚动,
android:inputType="textMultiLine"