MIFloatingButton 1.0.8

MIFloatingButton 1.0.8

Tushar Sanchaniya 维护。




<html
lang="en"

data-color-mode="auto" data-light-theme="light" data-dark-theme="dark"
data-a11y-animated-images="system" data-a11y-link-underlines="true"














MIFloatingButton/README.md at main · TusharSanchaniya-mi/MIFloatingButton · GitHub - CocoaPods 中文



<meta name="hovercard-subject-tag" content="repository:822923968" data-turbo-transient>


<meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I">

<meta name="user-login" content="">



<meta name="viewport" content="width=device-width">



  <meta name="description" content="Floating Button is a UI element that use to a button that triggers the primary action for a particular screen. - MIFloatingButton/README.md at main · TusharSanchaniya-mi/MIFloatingButton">

  <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub">

<link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub">
<meta property="fb:app_id" content="1401488693436528">
<meta name="apple-itunes-app" content="app-id=1477376905, app-argument=https://github.com/TusharSanchaniya-mi/MIFloatingButton/blob/main/README.md" />

  <meta name="twitter:image:src" content="https://opengraph.githubassets.com/0dce8716de820f1e3a0f44e169f46ae4234c5ee1b4b0058a5d22d58b8f013e5a/TusharSanchaniya-mi/MIFloatingButton" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="MIFloatingButton/README.md at main · TusharSanchaniya-mi/MIFloatingButton" /><meta name="twitter:description" content="Floating Button is a UI element that use to a button that triggers the primary action for a particular screen. - TusharSanchaniya-mi/MIFloatingButton" />

  <meta name="hostname" content="github.com">



    <meta name="expected-hostname" content="github.com">




  <meta name="turbo-cache-control" content="no-cache" data-turbo-transient>
<meta data-hydrostats="publish">

<meta name="turbo-body-classes" content="logged-out env-production page-responsive">





<div class="position-relative js-header-wrapper ">
  <a href="#start-of-content" data-skip-target-assigned="false" class="px-2 py-4 color-bg-accent-emphasis color-fg-on-emphasis show-on-focus js-skip-to-content">Skip to content</a>

  <span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full">
<span style="width: 0%;" data-view-component="true" class="Progress-item progress-pjax-loader-bar left-0 top-0 color-bg-accent-emphasis"></span>

<react-partial
partial-name="keyboard-shortcuts-dialog"
data-ssr="false"

  <div hidden="hidden" data-view-component="true" class="js-stale-session-flash stale-session-flash flash flash-warn flash-full mb-3">

    <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
<path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>




<button id="icon-button-85769320-8303-4e63-a486-b4c18595e7a0" aria-labelledby="tooltip-42edf956-3db2-4cfb-9d7a-465d65841ac6" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--medium flash-close js-flash-close">  <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x Button-visual">
<path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path>


关闭警报


<div id="js-flash-container" class="flash-container" data-turbo-replace>


最新提交

 

历史记录

历史
155行(112LOC)· 7.52KB

README.md

文件元数据和控件

155行(112LOC)· 7.52KB

适用于SwiftUI的MIFloatingButton

使用SwiftUI轻松可定制的浮动按钮菜单。

CI Status Platform iOS

要求 🛠️

  • iOS 15.0+
  • Swift 5.8+
  • SwiftUI

安装 ⚙️

Swift包管理器

Swift包管理器是一种自动化Swift代码分发的工具,它集成在Swift编译器中。

一旦您设置了Swift包,将MIFloatingButton作为依赖项添加就与将其添加到Package.swift或Xcode中的Package列表中的依赖项值一样简单。

dependencies: [
    .package(url: "https://github.com/TusharSanchaniya-mi/MIFloatingButton", .upToNextMajor(from: "1.0.0"))
]

CocoaPods

CocoaPods是Cocoa项目的一个依赖管理器。有关使用和安装说明,请访问其网站。要使用CocoaPods将MIFloatingButton集成到Xcode项目中,请在Podfile中指定它

pod 'MIFloatingButton'

主要功能:✨

MIFloatingButton提供了一个具有吸引力的UI设计的操作按钮列表,有3种设计方式来显示浮动按钮在屏幕上。

  • both:表示有UI和文本标题的按钮。(默认)
  • iconOnly:表示仅包含图标的按钮。
  • textOnly:表示仅包含文本的按钮。

示例

import SwiftUI

struct ContentView: View {

    @State var arrFloatingItem: [FloatingItem] = []

    func fillFloatingText() {
        let arrIconName = ["email_ic", "person", "person_ic", "xmark.bin"]
        for item in 0..<arrIconName.count {
            arrFloatingItem.append(FloatingItem(title: "Button \(item)", iconName: arrIconName[item]))
        }
    }

    let configItem = FloatingItemConfiguration(floatingIcon: "plus")

    var body: some View {

        VStack {
            MIFloatingButton(arrFloatingItem: $arrFloatingItem, config: configItem) { floatingItem in
                // Perform your action
            } childView: {
                VStack {
                    List {
                        ForEach(1 ... 30, id: <span class="pl-kos">.self) { _ in
                            HStack(spacing: 15) {
                                Image(systemName: "person.fill")
                                    .padding(10)
                                    .background(.green.opacity(0.3))
                                    .clipShape(Circle())
                                VStack(alignment: .leading) {
                                    Text("Fulan bin fulan")
                                    Text("Aenean sagittis leo ut massa sagittis varius ac eu mauris. Nunc interdum tellus vestibulum bibendum pulvinar.")
                                        .font(.caption)
                                        .foregroundColor(.secondary)
                                }
                            }
                        }
                        .listRowSeparator(.hidden)
                    }
                }
            }
            .onAppear() {
                fillFloatingText()
            }
        }
    }
}

#Preview {
    ContentView()
}

屏幕截图

both iconOnly textOnly
Simulator Screenshot - iPhone 15 Pro - 2024-07-02 at 13 46 33 Simulator Screenshot - iPhone 15 Pro - 2024-07-02 at 13 47 01 Simulator Screenshot - iPhone 15 Pro - 2024-07-02 at 13 47 17

🙋 作者

📱 查看我们其他Mobile UI库列表 🤩



💻 查看我们其他Web库列表 🤩



查看我们的作品 📜



📄 许可证

MIFloatingButton遵循MIT许可协议

如果您在我们的项目中使用了开源库,请确保引用我们,并在www.mindinventory.com给我们一个星标。

app development

<template id="site-details-dialog">



</div>

<div id="js-global-screen-reader-notice" class="sr-only mt-n1" aria-live="polite" aria-atomic="true" ></div>
<div id="js-global-screen-reader-notice-assertive" class="sr-only mt-n1" aria-live="assertive" aria-atomic="true"></div>