Border类模拟在Xamarin的Andr​​oid [英] Border Class analog in Xamarin Android

查看:186
本文介绍了Border类模拟在Xamarin的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提请阴阳烛图(500 itmes)。在WPF中,我可以用500的边界(System.Windows.Controls.Border)内的ScrollViewer 1。
我在需要时也可以更改任何项目。

I want to draw a candlestick chart (500 itmes). In WPF, I can use 500 borders (System.Windows.Controls.Border) inside 1 scrollviewer. I also can change any item when it's needed.

我怎样才能做到在Xamarin.Android一样吗? Xamarin.Android不包含边框类。

How can I do the same in Xamarin.Android? Xamarin.Android doesn't contain the Border class.

推荐答案

您可以使用滚动型,包含的LinearLayout 包含本身500次一个简单的<视图> 具有规模和可拉伸行程作为背景

you could use a ScrollView, containing a LinearLayout containing itself 500 times a simple <View> that has a size and a drawable stroke as background

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    >
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="bottom"
        >
        <View
            android:layout_width="50dp"
            android:layout_height="100dp"
            android:background="@drawable/border_white"
            />
        <View
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:background="@drawable/border_white"
            />

和在res /绘,一个名为border_white文件

and in res/drawable, a file named border_white

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <stroke android:width="2dip" android:color="@android:color/white" />
</shape>

但它会是pretty慢我告诉你,(如在Windows上,可能)。

but it'll be pretty slow I tell you (like on Windows, probably).

这篇关于Border类模拟在Xamarin的Andr​​oid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆