1.效果展示
2.代码分析
输入框:
1.一个Icon图标
2.输入框
3.隐藏提示文字
4.水平分布,需要Row()布局
由于BasicTextField组件没有Icon属性、没有placeholde属性,需要自行封装Icon图标实现以上效果
3.代码实现
@Composable
fun MyTextField(
// val (text, setText) = remember{ mutableStateOf("") }
text: String,
setText: (String)->Unit
){
Row(
Modifier
.fillMaxWidth()
.background(
Color(0x66F5F5F5),
shape = RoundedCornerShape(12