【问题标题】:How To Create a Vertical SeekBar in Xamarin?如何在 Xamarin 中创建垂直 SeekBar?
【发布时间】:2015-03-09 22:40:40
【问题描述】:

我正在使用 Xamarin 免费版,我正在尝试创建以下搜索栏

搜索栏将是白色的,带有白色拇指,旁边的金色框是内容

图片链接: http://s8.postimg.org/gpt6ao5xh/Veritcal_Seek_Bar.jpg

唯一的问题是该格式将有 6 个 SeekBars 连续向下

所有的例子都是水平搜索栏,垂直搜索栏不多

我目前的做法是使用

android:Rotation="270"

这确实使它垂直,但我无法实现上述格式,一切都很有趣

有人有什么想法吗?

【问题讨论】:

    标签: android xamarin xamarin.android xamarin-studio


    【解决方案1】:

    一种解决方案是在顶部布局上使用旋转,如以下代码所示

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="260dp"
        android:rotation="270">
    
        <SeekBar
            android:layout_width="260dp"
            android:layout_height="wrap_content"
            android:progress="50" />
    
        <SeekBar
            android:layout_width="260dp"
            android:layout_height="wrap_content"
            android:progress="70" />
    
        <SeekBar
            android:layout_width="260dp"
            android:layout_height="wrap_content"
            android:progress="50" />
    
        <SeekBar
            android:layout_width="260dp"
            android:layout_height="wrap_content"
            android:progress="20" />
    
    </LinearLayout>
    

    另一种解决方案是使用自定义 VerticalSeekBar(相同的旋转概念),例如 AndroSelva, Vertical-SeekBar-Android 实现

    <android.widget.VerticalSeekBar
            android:layout_width="wrap_content"
            android:layout_height="260dip" />
    

    或者有你自己真正的垂直搜索栏实现。

    .


    https://github.com/MostafaGazar/CircularImageView-Xamarin-查看我最新的图书馆项目

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-29
      • 1970-01-01
      • 2019-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多