程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了UIView 中的 swift ios UIButton 不起作用大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决UIView 中的 swift ios UIButton 不起作用?

开发过程中遇到UIView 中的 swift ios UIButton 不起作用的问题如何解决?下面主要结合日常开发的经验,给出你关于UIView 中的 swift ios UIButton 不起作用的解决方法建议,希望对你解决UIView 中的 swift ios UIButton 不起作用有所启发或帮助;

我使用故事板制作的 我为自定义标签栏制作了另一个视图控制器,并创建了一个名为 innerContents 的 UIVIEw。

为其中的设置页面制作了另一个视图控制器,并使用 addSubvIEw 在 innerContents 中放置了另一个视图控制器。

CustomTabBar with innerContents UIView

这就是innerTabbar主CustomTabbar视图控制器页面

other ViewController 我将把那个 VIEwController 放在 innerContents 中。所以我写了 addSubVIEw。他们正在显示,但 UIbuttons 不起作用。仅适用于 ScrollVIEw。

我该如何解决?

code

我确认所有插座都连接正常。 但是在另一个视图控制器的 UiVIEw 中的 UIScrollVIEw 中的 UIVIEw 中的 UIbutton 不起作用。

@H_556_2@mainCustomTabbar Page vIEwController > innerContents > otherVIEwController(addSubVIEw) > UIVIEw > UI ScrollVIEw > UIVIEw > UIVIEw > UIbutton(它不工作。我想修复)

            if currentPage != 5 {
                currentPage = 5
                print("탭바 클릭 5")
                guard let AppSet = self.storyboard?.instantiateVIEwController(IDentifIEr: "AppSetVIEwController") as? AppSetVIEwController else {return}
                AppSet.vIEw.frame = ContentsVIEw.bounds
                AppSet.vIEw.autoresizingMask = [.flexibleWIDth,.flexibleHeight]
                AppSet.vIEw.tag = 500
                removeSubvIEw(tag: NowTag)
                NowTag = 500
                ContentsVIEw.addSubvIEw(AppSet.vIEw)
                let root = UIApplication.shared.windows.first?.rootVIEwController
                root?.addChild(AppSet)
                AppSet.dIDMove(toparent: root!)
                page5Mode()
                return
            }
        }

//
//  AppSetVIEwController.swift
//  rael
//
//  Created by HongDaehyeon on 2021/07/08.
// 앱 설정 페이지를 위한 페이지 입니다.

import UIKit

class AppSetVIEwController: UIVIEwController {
    
    overrIDe func vIEwDIDLoad() {
        super.vIEwDIDLoad()
    }
    
    @IBOutlet var ContentVIEw: UIVIEw!{
        dIDSet {
            self.ContentVIEw.isUserInteractionEnabled = true
        }
    }
    @IBOutlet var ScrollvIEw: UIScrollVIEw!{
        dIDSet{
            self.ScrollvIEw.isExclusivetouch = true
        }
    }
    
    //지갑정보
    @IBACtion func walleTinfo(_ sender: Any) {
        print("지갑정보")
    }
    
    //알림설정
    @IBACtion func alertSet(_ sender: Any) {
        print("알림설정")
    }
    
    //인증방식설정
    @IBACtion func authSet(_ sender: Any) {
        print("인증방식설정")
    }
    
    //공지사항
    @IBACtion func noticeNav(_ sender: Any) {
        let vc = self.storyboard?.instantiateVIEwController(IDentifIEr: "SetTingsnoticeVIEwController")
        let navController = UINavigationController(rootVIEwController: vc!)
        navController.modalPresentationStyle = .fullScreen
        navController.modalTransitionStyle = .crossdissolve
        navController.setNavigationbarHIDden(true,animated: falsE)
        self.present(navController,animated: true,completion: nil)
    }
    
    //FAQ
    @IBACtion func faqNav(_ sender: Any) {
        let vc = self.storyboard?.instantiateVIEwController(IDentifIEr: "FaqVIEwController")
        let navController = UINavigationController(rootVIEwController: vc!)
        navController.modalPresentationStyle = .fullScreen
        navController.modalTransitionStyle = .crossdissolve
        navController.setNavigationbarHIDden(true,completion: nil)
    }
    
    //고객상담
    @IBACtion func serviceCenter(_ sender: Any) {
        print("고객상담")
    }
    
    //약관 및 정책
    @IBACtion func termsNav(_ sender: Any) {
        print("약관 및 정책")
    }
    
    //지갑 삭제
    @IBACtion func removeWallet(_ sender: Any) {
        print("지갑삭제")
    }
    
    //전화걸기
    @IBACtion func callservice(_ sender: Any) {
        print("전화걸기")
        let urlString = "tel://1588-8282"
        let numberURL = NSURL(String: urlString)
        UIApplication.shared.open(numberURL! as URL,options: [:],completionHandler: nil)
    }
    
    //앱정보 로딩
    @IBOutlet var appVer: UILabel!{
        dIDSet{
            self.appVer.text = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
        }
    }

}```

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

大佬总结

以上是大佬教程为你收集整理的UIView 中的 swift ios UIButton 不起作用全部内容,希望文章能够帮你解决UIView 中的 swift ios UIButton 不起作用所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。