答案 0 :(得分:0)
这样做......
getInfosUser(maxRetries = 2): Observable<Response> {
return this.authHttp.get(this.apiUrl+'getuserinfos')
.map((response: Response) => {
return response;
})
.catch((error: any) => {
if ( (error.status === 401 || error.status === "401") && maxRetries > 0 ) {
return Observable.fromPromise(this.authService.handleError(error)).concat(getInfosUser(maxRetries - 1));
}
else {
return Observable.throw( new Error(error.status) );
}
})
}
,设置所需图像和背景颜色UIImageView
,并在界面构建器(故事板)中将边框样式设置为“无边框样式”答案 1 :(得分:0)
添加 UITextField
将子视图添加为 imageView
设置 UITextField的Alpha
下面的示例代码:
private void MasterCheck()
{
this.pnlProgress.Visibility = System.Windows.Visibility.Visible;
//I'm using progress bar functionality in ReturnMasters method
Thread myNewThread = new Thread(() => Auditor.AuditMasterSlides(Globals.ThisAddIn.Application.ActivePresentation, this.pnlMaster, this, token));
token = new CancellationTokenSource();
myNewThread.Start();
this.pnlProgress.Visibility = System.Windows.Visibility.Collapsed;
}
public static void AuditMasterSlides(PPT.Presentation pres, Panel panel, MainProofingTaskPaneControl control, CancellationTokenSource cancToken)
{
IDictionary<string,MasterSlide> masterSlides = ReturnMasters(pres, cancToken, control);
control.ShowAndCollapse(panel);
control.RemovePanelChildren(panel);
if (masterSlides.Count>1)
{
//control.AddControlToPanel(panel, new MasterCheckControlOK());
}
else
{
control.AddControlToPanel(panel, new MasterCheckControlOK());
}
}
internal void RemovePanelChildren(Panel panel)
{
this.Dispatcher.Invoke(() =>
{
for (int i = panel.Children.Count - 1; i >= 0; i--)
{
panel.Children.RemoveAt(i);
}
});
}
internal void AddControlToPanel(Panel panel, Control control)
{
MasterCheckControlOK newControl = new MasterCheckControlOK();
this.Dispatcher.Invoke(() =>
{
panel.Children.Add(newControl);
});
}
答案 2 :(得分:0)
导入UIKit
类ViewController:UIViewController {
@IBOutlet weak var txtpassword: UITextField!
@IBOutlet weak var txtUserName: UITextField!
@IBOutlet weak var txtView: UITextView! //your textView
override func viewDidLoad() {
super.viewDidLoad()
//navigationBarColor()
setTextFieldSpace( textField :txtUserName)
setTextFieldSpace( textField :txtpassword)
//textField border
txtpassword.borderStyle = .none
txtUserName.borderStyle = .none
}
//MARK: - Button Action
// password show hide
@IBAction func btnShowPasswordClick(_ sender: UIButton) {
if txtpassword.isSecureTextEntry{
txtpassword.isSecureTextEntry = false
}else{
txtpassword.isSecureTextEntry = true
}
}
//for set space in left side of textField
func setTextFieldSpace( textField :UITextField){
let lblSpace = UILabel()
lblSpace.frame = CGRect.init(x: 0, y: 0, width: 5, height: 5)
lblSpace.backgroundColor = .clear
textField.leftView = lblSpace
textField.leftViewMode = .always
textField.contentVerticalAlignment = .center
}
}
//查看此Out put