小编caj*_*iko的帖子

为什么Lollipop上的CardViews之间没有空间?

我尝试使用它CardView并且它在5.0以下工作得很好,但在棒棒糖上看起来很奇怪.

在此输入图像描述

在此输入图像描述

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">

<android.support.v7.widget.CardView android:layout_width="match_parent"
    android:layout_height="200dp">
    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="card1"
        android:textAppearance="?android:attr/textAppearanceLarge" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView android:layout_width="match_parent"
    android:layout_height="200dp">

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="card2"
        android:textAppearance="?android:attr/textAppearanceLarge" />
</android.support.v7.widget.CardView>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我在使用时会遇到同样的问题RecyclerView,如果它在Lollipop上运行,我是否需要添加一些东西?

android android-cardview

79
推荐指数
4
解决办法
4万
查看次数

如何将Unicode十六进制数字变量转换为NSString中的字符?

现在我有一系列的unicode数字,我想在UILabel中显示它们,如果我对它们进行硬编码,我可以显示它们,但是那太慢了,所以我想用一个变量代替它们,然后更改变量并获取相关的字符。例如,现在我知道unicode是U + 095F,我想在UILabel中显示U + 095F到U + 096f的范围,我可以使用诸如

NSString * str = [NSString stringWithFormat:@“ \ u095f”];

但我想这样做

NSInteger hex = 0x095f;

[NSString stringWithFormat:@“ \ u%ld”,(long)hex];

我可以像使用一样自动更改十六进制@"%ld", (long)hex,所以有人知道如何实现吗?

unicode objective-c nsstring uilabel ios

1
推荐指数
1
解决办法
1378
查看次数