这只是一个基本问题,您在哪些事件中使用<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="350dp"
android:id="@+id/cardview_map_rb"
android:background="@color/colorAccent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<fragment
android:id="@+id/maps_inside_card_rb"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="200dp"/>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="147dp"
android:id="@+id/sub_card_for_locs_rb">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/from_rb"
android:text="JAYAMAHAL"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/to_rb"
android:text="EJIPURA"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/time_id_rb"
android:textSize="19dp"
android:text="23:55:22 15-06-2016"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/booking_status_id_rb"
android:text="Pending"
android:textSize="19dp"
android:layout_marginLeft="60dp"/>
</LinearLayout>
<android.support.v7.widget.AppCompatButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/bookings_accept_button_rb"
android:text="Accept"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
?在Bootstrap Framework中写入时,您是否总是需要包含E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.cabbi.appstract, PID: 5522
android.view.InflateException: Binary XML file line #18: Error inflating class fragment
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at com.cabbi.appstract.RecyclerCardMapAdapter.onCreateViewHolder(RecyclerCardMapAdapter.java:57)
at com.cabbi.appstract.RecyclerCardMapAdapter.onCreateViewHolder(RecyclerCardMapAdapter.java:20)
at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:5482)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4707)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4617)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1994)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1390)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1353)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:574)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3028)
at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:2625)
at android.view.View.measure(View.java:17915)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5698)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1692)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:760)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
at android.view.View.measure(View.java:17915)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5698)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:465)
at android.view.View.measure(View.java:17915)
at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1560)
at android.view.View.measure(View.java:17915)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:846)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:512)
at android.view.View.measure(View.java:17915)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5698)
at android.support.design.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:668)
at android.support.design.widget.HeaderScrollingViewBehavior.onMeasureChild(HeaderScrollingViewBehavior.java:90)
at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onMeasureChild(AppBarLayout.java:1192)
at android.support.design.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:733)
at android.view.View.measure(View.java:17915)
at android.support.v4.widget.DrawerLayout.onMeasure(DrawerLayout.java:1075)
at android.view.View.measure(View.java:17915)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5698)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:465)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:135)
at android.view.View.measure(View.java:17915)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5698)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1692)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:760)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
at android.view.View.measure(View.java:17915)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5698)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:465)
at android.view.View.measure(View.java:17915)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5698)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1692)
at android.widget.L
?有关何时使用jumbotron
的示例表示赞赏。
答案 0 :(得分:9)
不,jumbotron只是一个组件,就像通常位于主页顶部的大横幅。可以把它想象成一个访客在访问您的网站时会看到的大囤积物。当您使用bootstrap时,我认为99%的时间可能需要的组件是grid。休息取决于您网站的要求。
网格对于使网页的行/列样式布局具有响应性(流量取决于设备的大小)非常有用。
答案 1 :(得分:2)
Jumbotron
只是一个样式元素。 Bootstrap有一些默认属性应用于该元素,使其成为一个非常好的眼睛捕捉器。
您不需要包含它,但如果您愿意,也可以。我用它来显示主要的商业概念,展示商品或折扣。
用例的一个很好的例子是查看商业网站。 here你可以看到他们如何使用幻灯片进行宣传,在jumbotron
- 类似的元素中为吸引眼球。
使用它只是个人偏好的问题。
答案 2 :(得分:1)
Jumbotron是开发网站时的Bootstrap助手工具之一。没有必要在项目中使用它,这完全取决于您的设计结构。基本上使用此组件,您可以选择增加标题的大小,并为登录页面内容添加大量余量。 w3的另一个定义是,jumbotron表示一个大框,可以引起对某些特殊内容或信息的额外关注。有了这个说它是你想要指出的地方,也许是一些标题,公司引用一些漂亮的图形。