【发布时间】:2018-11-23 23:21:45
【问题描述】:
我在线性布局和卡片视图中添加了背景图像。在 CardView 下,我添加了另一个渐变背景图像并设置了 alpha 0.5。当我添加 TextView 并添加文本时,文本也变得半透明,如图所示。我尝试使用粗体外观,但没有用。 I have uploaded the Image
<?xml version="1.0" encoding="utf-8"?>
<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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.vikramgehlot.QuotesandStatus.Apj"
android:background="@drawable/materialbackground" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="215dp"
android:orientation="vertical">
<ImageView
android:layout_marginTop="0dp"
android:layout_width="match_parent"
android:layout_height="215dp"
android:src="@drawable/ic_format_quote_black_24dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.CardView
android:layout_margin="10dp"
android:layout_width="350dp"
android:layout_height="70dp"
app:cardCornerRadius="40dp"
android:alpha=".5">
<LinearLayout
android:layout_margin="6dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/rectangle"
android:alpha=".5">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="fill"
android:text="Don’t let a mad world tell you that success is anything other than a successful present moment. "
android:textColor="@color/black"
android:textStyle="bold"
android:textSize="13dp"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
【问题讨论】:
-
请添加您的 .xml 文件
-
添加了@Deadpool。
标签: android android-layout android-fragments