为了避免混淆实际navigationbar是什么,这里有一个
正如您所看到的,我使用以下方法添加了一种新颜色而不是标准黑色:
<item name="android:navigationBarColor">@color/colorBackground</item>
Run Code Online (Sandbox Code Playgroud)
但图标现在几乎看不见,所以我想将它们更改为黑色,或者至少更暗。我已经搜索过 SO 和 webb 但空手而归。有任何想法吗?
我正在使用BottomNavigationBar和单击导航栏中的任何图标时。我希望它进入下一个屏幕。这就是我在这里使用命名路由的原因。
main.dart 代码
import 'package:flutter/material.dart';
import 'Screens/profilePage1/profilePage1.dart';
void main() => runApp(MyStatefulWidget());
class MyStatefulWidget extends StatefulWidget {
@override
_MyStatefulWidgetState createState() => _MyStatefulWidgetState();
}
class _MyStatefulWidgetState extends State<MyStatefulWidget> {
int _selectedIndex = 0;
void _onItemTapped(int index) {
setState(() {
_selectedIndex = index;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
routes: {
// When navigating to the "/" route, build the FirstScreen widget.
'/first': (context) => ProfilePage1(),
// When navigating to the "/second" route, build the SecondScreen widget.
'/second': …Run Code Online (Sandbox Code Playgroud) 我在 SwiftUI/Combine 应用程序中使用 Firebase,并且注意到一些警告,我想对其进行故障排除。他们没有破坏事情,但我想解决它们。我使用带有最新 Swift 包依赖项的 Xcode 12.4 时收到这些警告:GoogleUtilities 7.2.2 和 Firebase 7.7.0。
这是控制台中出现的第一个警告:
[GoogleUtilities/AppDelegateSwizzler][I-SWZ001014] App Delegate does not conform to UIApplicationDelegate protocol.
Run Code Online (Sandbox Code Playgroud)
作为参考,这是我配置 Firebase 的方式:
import SwiftUI
import Firebase
@main
struct MyApp: App {
@StateObject var authState = AuthState()
init() {
FirebaseApp.configure()
}
var body: some Scene {
WindowGroup {
RootView()
.environmentObject(authState)
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是第二个警告,在我使用修饰符设置导航栏标题后出现.navigationBarTitle。
[LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't …Run Code Online (Sandbox Code Playgroud) 我想要做的是,使这样的布局:
标题
日期
滚动的长文本
导航栏粘在底部
好吧,我已经做了一切,但滚动有一点问题.我只想滚动文字.标题和日期应该贴在顶部,导航栏应该放在活动的底部.是的,它可以工作,但我的导航栏重叠文本:/
我尝试了一切,我发现有一个解决方案,为Scrollview设置固定高度,但这不适用于每个设备,不是吗?我可能可以在代码中进行一些计算,并在其上改变高度,但我想保留XML.
有人有什么建议吗?
这是我的XML文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.6"
android:orientation="vertical" >
<TextView
android:id="@+id/feed_title"
style="@style/h1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical" />
<TextView
android:id="@+id/feed_info"
style="@style/h2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<ImageView
android:id="@+id/feed_fav_ico"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_gravity="center_vertical|right"
android:background="@drawable/ic_fav_off" />
</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollY="20dp" >
<TextView
android:id="@+id/feed_text"
style="@style/text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Loren ipsum full tekst" />
</ScrollView>
</LinearLayout>
<!-- Buttons -->
<LinearLayout …Run Code Online (Sandbox Code Playgroud) 所以我的导航栏出了问题.我把它的宽度设置为100%.但我希望看到结束,因为它有圆角......
所以这样:| (=======)|
不像现在这样:| (========== |
#nav {
height: 60px;
font-size: 30px;
line-height: 60px;
vertical-align: middle;
text-align: center;
background-color: #0080FF;
width: 100%;
border: 10px solid #16044E;
border-radius: 20px;
z-index: 1;
}
#nav ul {} #nav li {
display: inline;
text-align: center;
margin: 20px;
}
#nav a {
color: white;
text-decoration: none;
}Run Code Online (Sandbox Code Playgroud)
<ul id="nav">
<li><a href="">Home</a>
</li>
<li><a href="">Courses</a>
</li>
<li><a href="">Subjects</a>
</li>
<li><a href="">Sign Up</a>
</li>
<li><a href="">Log In</a>
</li>
</ul>Run Code Online (Sandbox Code Playgroud)
我正在使用React Native创建一个移动应用程序,我决定使用来自网站“ https://github.com/beefe/react-native-navigation-bar ” 的导航栏,但我不知道如何使用它在我的代码中。
我希望您向我发送网站“ https://github.com/beefe/react-native-navigation-bar ” 的导航栏示例。
我需要有一个密切的按钮(在这种特殊情况下),左侧的导航栏,如下图所示。我仅在弹出窗口中需要它,因此其他元素/导航没有潜在的问题。
Google对此提出了一些建议,但我只看到了iOS示例(这并不是要处理的大事iOS custom renderer),但没有提示如何使用Android(轻松)处理它。
需要明确的是,它需要使用它来Xamarin.Forms定义与此(或代码隐藏)类似的内容:
<ContentPage.ToolbarItems>
<ToolbarItem Text="X" Priority="-1" Command="{Binding GoCancel}"/>
<ToolbarItem Icon="icon_save" Command="{Binding GoSave}"/>
</ContentPage.ToolbarItems>
Run Code Online (Sandbox Code Playgroud)
有什么想法吗?
navigationbar ×10
android ×3
react-native ×2
swiftui ×2
colors ×1
css ×1
firebase ×1
flutter ×1
html ×1
ios ×1
list ×1
nav ×1
navigation ×1
scrollview ×1
xamarin ×1