首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在xamarin (visual studio)中刷卡给android,就像地图/新闻中的谷歌卡

在xamarin (visual studio)中刷卡给android,就像地图/新闻中的谷歌卡
EN

Stack Overflow用户
提问于 2017-01-07 09:13:37
回答 1查看 823关注 0票数 1

下面是我的应用程序布局,我已经包括卡视图。但无法像地图/新闻中的谷歌卡那样刷卡。

代码语言:javascript
复制
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="8dp">
        <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
            android:id="@+id/card_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            card_view:cardCornerRadius="8dp"
            android:elevation="2dp"
            card_view:cardBackgroundColor="@color/orange">
            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/white"
                android:id="@+id/contenLayout">
                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:id="@+id/imgSource"
                    android:layout_centerInParent="true"
                    android:scaleType="fitXY"
                    android:src="@drawable/image" />
                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/mytextview"
                    android:textSize="20sp"
                    android:layout_alignParentBottom="true"
                    android:textColor="@color/content"
                    android:background="@color/orange"
                    android:gravity="center_horizontal"
                    android:paddingBottom="5dp"
                    android:paddingTop="5dp"/>
            </RelativeLayout>
        </android.support.v7.widget.CardView>
    </LinearLayout>

我需要在每个刷卡中加载不同的数据。刷卡是可逆的,不像简单的触摸事件的屏幕。

下一张卡应该是可见的,当我从左到右或从右到左刷卡时。我还在xamarin论坛上查看了解决方案,并找到了仅适用于IOS的only视图。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-01-22 03:17:03

我在Xamarin论坛上找到了解决方案。实际上,我试图实现类似于ViewPager和Carousel的功能。下面是讨论ViewPager的链接。

https://forums.xamarin.com/discussion/3174/viewpager-example-with-android-4-0

下面是Cheesebaron在Git https://github.com/Cheesebaron/ViewPagerIndicator上编写的非常好的示例代码

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41519786

复制
相关文章

相似问题

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