我正在尝试嵌入浮动操作按钮。下面是我的xml文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:descendantFocusability="blocksDescendants"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:background="@drawable/border"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/proformo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:text="PI 12343"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:orientation="horizontal">
<TextView
android:id="@+id/shippingStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_weight="1"
android:text="Cargo Shipped"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000"
android:textStyle="bold" />
<TextView
android:id="@+id/shippingDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="on07 oct 2015"
android:textColor="#000" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="20dp"
android:orientation="horizontal">
<TextView
android:id="@+id/invoiceNumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="PI 12345"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="@+id/invoiceDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="on Dec 2016"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="20dp"
android:orientation="horizontal">
<TextView
android:id="@+id/shipment_ref_no_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Shipment Ref.# :"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="@+id/shipment_ref_no_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="4312412412"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="20dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/etdLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ETD:"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="@+id/etdValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="24 oct 2015"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:id="@+id/etaLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ETA:"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="@+id/etaValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="09 dec 2014"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="20dp"
android:orientation="horizontal">
<com.android.volley.toolbox.NetworkImageView
android:id="@+id/networkImage"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginRight="10dp"
android:scaleType="centerCrop"
android:src="@drawable/noimage" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/productName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BioMass Pellets"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/quantity_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Quantity: "
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="@+id/quantity_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="40mts"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/amount_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Amount: "
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="@+id/amount_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="200 USD"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/rate_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rate"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="@+id/rate_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="40 USD"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:orientation="horizontal">
<TextView
android:id="@+id/shipped"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Shipped By "
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="@+id/shippedcompany"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:orientation="horizontal">
<android.support.design.widget.FloatingActionButton
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/ic_dialog_email"
app:backgroundTint="@color/colorPrimaryDark"
app:borderWidth="0dp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
问题是Im会收到以下错误消息,
Android.View.InflateException:二进制XML文件行#300:在Android.View.LayoutInflater.CreateView(LayoutInflater.CreateViewFromTag(LayoutInflater.java:702)在Android.View.LayoutInflater.rInflate(LayoutInflater.761)在Android.View.LayoutInflater.rInflate(LayoutInflater.rInflate(LayoutInflater.769)在.View.Measure(view.java:16831)在Android.View.ViewGroup.MeasureChildWithMargins(view.java:5245)在Android.Widget.LinearLayout.MeasureChildBeForelayout(LinearLayout.java:1410)在Android.Widget.LinearLayout.MeasureVertical(LinearLayout.java:695)在Android.Widget.LinearLayout.OnMeasure(LinearLayout.java:588)在oid.view.viewgroup.MeasureChildWithMargins(viewgroup.java:5245)位于Android.widget.framelayout.onMeasure(framelayout.java:310)位于Android.support.v7.widget.contentframelayout.onMeasure(contentframelayout.java:135)位于Android.view.view.measure(view.java:16831)位于Android.view.view.measure(view.java:16831)位于wgroup.measurechildwithmargins(viewgroup.java:5245)在android.widget.framelayout.java:310)在com.android.internal.policy.impl.phonewindow$decoview.onmeasure(phonewindow.java:2586)在android.view.view.measure(view.java:16831)在android.view.view.measure(view.java:16831)在
我该怎么解决这件事?
问题出在您的“?android:attr/textappearanceMedium”
部分。膨胀不能膨胀使用这种元件的元件。
这是我的activity_login:
在尝试为Android使用新的时发生崩溃,并希望分享我的解决方案。 在android appcompat库中尝试新的TextInputField会使我的应用程序崩溃。这是我的布局xml。 我的错误是: 解决方案:将属性添加到,使lead标签如下所示:
是否有一个隐藏在Internet中的ByteBuffers方面的gzip放气库?允许我们推送原始数据然后提取放气数据的东西?我们已经搜索过了,但只找到了处理InputStreams和OutputStreams的库。 我们的任务是创建gzip过滤器,用于在管道架构中减少字节缓冲流。这是一个pull架构,其中最后一个元素从早期元素中提取数据。我们的gzip过滤器处理字节缓冲流,没有单个流对象可用。 我
对于我的一个活动中的布局,我在右下角有一个浮动的动作按钮。但是由于某种原因,尽管设置了,但是按钮的边距上没有填充。 下面是XML代码: 会得到一些帮助的,谢谢!