简体   繁体   中英

set color inside textfield near border

I want to change textfield color not background color but near part of textfield border just like shadow. As shown in image.

在此输入图像描述

如果你想在图像中显示时在UITextField添加阴影,那么最简单的方法就是该UITextField设计图像并将其设置为UITextField背景。

IT's so simple just slice that image and put that image in Textfield background. or Use the Code suggest by @Mrug.

textField.layer.cornerRadius=5.0f; 
textField.layer.masksToBounds=YES; 
textField.layer.borderColor=[[UIColor blackColor]CGColor];
textField.layer.borderWidth= 1.5f;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM