我在使用CardView透明度和card_elevation时遇到了一些麻烦.尝试使用CardView透明的结果是:
没有透明度:
我想要得到的是这样的:
这是我的xml:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/eifell"
android:padding="10dp"
tools:context=".MainActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:background="@android:color/transparent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/newsCardView"
android:layout_width="match_parent"
android:layout_height="175dp"
card_view:cardBackgroundColor="#602B608A"
card_view:cardElevation="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent">
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Retrofit + Realm + Gson,但是当使用RealmList时,应用程序会卡住.
如果我删除RealmList对象一切正常,但我需要对象列表.
logcat的:
(32099): Background sticky concurrent mark sweep GC freed 278516(15MB) AllocSpace objects, 0(0B) LOS objects, 25% free, 23MB/31MB, paused 2.533ms total 1.049s
(32099): Background partial concurrent mark sweep GC freed 137132(8MB) AllocSpace objects, 0(0B) LOS objects, 40% free, 23MB/39MB, paused 4.211ms total 188.951ms
(32099): Background sticky concurrent mark sweep GC freed 271335(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 3.998ms total 236.868ms
(32099): Background sticky concurrent mark sweep GC freed 143812(8MB) AllocSpace …
Run Code Online (Sandbox Code Playgroud) 我正在使用Gson作为转换器通过Retrofit解析我的响应,但即使有积极的回应,我也总是变得虚假.
就是这样的
响应:
{"groups":{"success":true}}
Run Code Online (Sandbox Code Playgroud)
GroupsResponseClass
public class GroupsResponse {
@SerializedName("success")
private boolean mSuccess;
GroupsResponse() {}
public boolean isSuccess() {
return mSuccess;
}
public void setSuccess(boolean success) {
mSuccess = success;
}
}
Run Code Online (Sandbox Code Playgroud)
我停止使用GsonConverter并仍然获得一个成功false值的对象