首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >未显示Xamarin.Android卡视图标高

未显示Xamarin.Android卡视图标高
EN

Stack Overflow用户
提问于 2018-05-23 21:48:02
回答 1查看 516关注 0票数 0

我在RecyclerView中有一个CardView,但是卡的抬高没有显示阴影。

我试着按照其他答案中的建议使用clipToPadding,也尝试了在父ViewGroup上使用填充,但都没有用。我在下面发布了两个相关的布局文件。

任何建议都将不胜感激。

包含RecyclerView的布局

代码语言:javascript
运行
复制
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
 >
  <ProgressBar
  android:layout_width="wrap_content"
  android:layout_height="80dp"
  android:id="@+id/ProgressBar"
  android:indeterminate="true"
  android:layout_gravity="center"
  android:layout_margin="30dp"
  android:layout_centerVertical="true"
  android:layout_centerInParent="true"
  android:background="@drawable/ProgressBarStyle"
  android:visibility="visible" />
<android.support.v7.widget.RecyclerView
  android:id="@+id/RecyclerView"
  android:scrollbars="vertical"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
   />
<TextView
  android:id="@+id/textGuest"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:gravity="center"
  android:visibility="gone"
  android:text="Please sign in to start saving your favourite recipes"
  android:layout_marginTop="30dp"
  android:padding="10dp" />
</LinearLayout>

卡片视图布局

代码语言:javascript
运行
复制
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
card_view:cardElevation="0.7dp"
card_view:cardUseCompatPadding="true"
card_view:cardCornerRadius="5dp"
card_view:cardBackgroundColor="@color/PaleGreen">
<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:padding="5dp">
    <ImageView
        android:id="@+id/photoImageView"
        android:layout_width="fill_parent"
        android:layout_height="125dp" />
    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@android:color/darker_gray"
        android:layout_margin="2dp" />
    <TextView
        android:id="@+id/recipeNameTextView"
        android:layout_below="@id/photoImageView"
        android:gravity="center"
        android:textStyle="bold"
        android:layout_marginTop="5dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50490110

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档