如何将文本表单字段下的行扩展到可见性图标下?

时间:2019-01-03 18:20:34

标签: flutter passwords text-formatting

我有一个文本表单字段可输入密码,我在该行中添加了可见性图标按钮。如何将下划线扩展到图标下方? (在文本表单字段中有一个验证器,因此我希望扩展相同的行以使行为相同)。

1 个答案:

答案 0 :(得分:1)

import AVFoundation class MusicHelper { static let sharedHelper = MusicHelper() var audioPlayer: AVAudioPlayer? func playBackgroundMusic() { let aSound = NSURL(fileURLWithPath: Bundle.main.path(forResource: "MUSICNAME", ofType: "mp3")!) do { audioPlayer = try AVAudioPlayer(contentsOf:aSound as URL) audioPlayer!.numberOfLoops = -1 audioPlayer!.prepareToPlay() audioPlayer!.play() } catch { print("Cannot play the file") } } 中将import AVFoundation **//import at the top** var player: AVAudioPlayer? **//declare in code** MusicHelper.sharedHelper.playBackgroundMusic() **//paste in viewDidLoAd** 定义为IconButton

prefixIcon