我想使用navbar-toggler,但是我有两个问题,请先查看我的代码:
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<title>Admin</title>
</head>
<body>
<nav class="navbar navbar-toggler-sm navbar-light bg-success">
<button class="navbar-toggler navbar-toggler-right">
<span class="navbar-toggler-icon"></span>
</button>
<a href="#" class="navbar-brand" style="color: white">management</a>
<div class="collapse navbar-collapse">
<ul class="navbar-nav" style="color: white">
<li class="nav-item1"><a class="nav-link active"> Dashboard</a></li>
<li class="nav-item2"><a class="nav-link">Ads</a></li>
<li class="nav-item3"><a class="nav-link">Users</a></li>
</ul>
</div>
</nav>
1- navbar-brand和navbar-icon在导航栏中处于相反的位置(页面左右),但我希望它们彼此相邻!
2-我在导航栏中看不到导航项。为什么?
谢谢您的帮助!
答案 0 :(得分:0)
您需要向导航栏切换器添加@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (modeGroup.getCheckedRadioButtonId() == R.id.rb_mode_1) {
String[] nowTyping = input.getText().toString().split(" ");
ArrayList<String> wordArray = new ArrayList<>();
for (String word : nowTyping) {
wordArray.add(0, word);
}
String invertedSentence = TextUtils.join(" ", wordArray);
output.setText(invertedSentence);
}
else if (modeGroup.getCheckedRadioButtonId() == R.id.rb_mode_2){
//Do mode 2 stuffs...
}
....
}
和str.isalpha()
请参见https://getbootstrap.com/docs/4.0/components/navbar/
data-toggle