小编Muh*_*sal的帖子

如何将FloatingActionButton放入Fragment?

我怎么能把我放在fab我的片段上?请帮忙,我得到的错误,如.

android.view.InflateException:二进制XML文件行#13:错误膨胀类片段

在我的片段中.那么这是我的代码.

那问题就在于 getActivity().setContentView(R.layout.activity_ownerhome);

#ownerhome.java

public class ownerhome extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_ownerhome);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    }

}
Run Code Online (Sandbox Code Playgroud)

ownerhomeFragment.java

 @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View v =  inflater.inflate(R.layout.fragment_owner, container, false);


    ImageLoader.getInstance().init(UILConfig.config(getActivity()));
    lvCars = (ListView) v.findViewById(R.id.lvOnwer);

    pref = getActivity().getSharedPreferences("Login.conf", Context.MODE_PRIVATE);
    Log.d(TAG, pref.getString("username", ""));
    Log.d(TAG, pref.getString("password", ""));


    PostResponseAsyncTask taskRead = new PostResponseAsyncTask(getActivity(), this);
    tvUser = (TextView) v.findViewById(R.id.tvUser);
    tvUser.setText("Hello! "+pref.getString("username", ""));

    taskRead.execute("http://carkila.esy.es/user.php?owner="+pref.getString("username", ""));

    FloatingActionButton fab = …
Run Code Online (Sandbox Code Playgroud)

java android android-fragments

8
推荐指数
1
解决办法
3万
查看次数

如何使用 PHP 将 FPDF 中的表格居中

我正在使用 FPDF 库作为 PDF 文档生成器来生成表格。
问题是包含数据的表格不会居中,尽管我尝试在 $pdf->Cell() 参数中写入“C”。输出与左侧对齐,如下所示。

不居中

还有为什么当我添加新列(第 5 列)时,单元格移到底部,而右侧仍然有空格,如下所示。

重叠

我尝试在所有相关单元格内添加“C”参数,如下所示
$pdf->Cell(190,7,'Some text',0,1,'C');

还使用了这篇文章$pdf->SetXY(20,20);中的解决方案 ,但它仍然不起作用。

我当前的代码是:

<?php

require('fpdf.php');
$pdf = new FPDF('P','mm','A4');
$pdf->AddPage();

$pdf->Image('some_image.png',10,10,30,15);

$pdf->SetFont('Arial','B',16);
$pdf->Cell(190,7,'Some title',0,1,'C');
$pdf->SetFont('Arial','B',9);
$pdf->Cell(190,7,'Jl. Some address',0,1,'C');
$pdf->Cell(10,7,'',0,1);

$pdf->SetFont('Arial','B',9);
$pdf->Cell(190,7, $somestring1 ,0,1,'C');
$pdf->SetFont('Arial','',9);
$pdf->Cell(190,7,'to',0,1,'C');
$pdf->SetFont('Arial','B',9);
$pdf->Cell(190,7, $somestring2 ,0,1,'C');

$pdf->SetFont('Arial','B',8);
$pdf->Cell(10,7,'',0,1,'C');
$pdf->Cell(6,6,'NO',1,0,'C');
$pdf->Cell(23,6,'TUJUAN',1,0,'C');
$pdf->Cell(25,6,'PEMINJAM',1,0,'C');
$pdf->Cell(35,6,'KENDARAAN',1,0,'C');
$pdf->Cell(27,6,'JAM BERANGKAT',1,1,'C');
// If I add this cell, then i'll overlap/move to the bottom
$pdf->Cell(27,6,'JAM PULANG',1,1,'C');

$pdf->SetFont('Arial','',8);
$query = mysqli_query($someconn, "SELECT somequery");

$i = 1;
while …
Run Code Online (Sandbox Code Playgroud)

php fpdf

3
推荐指数
1
解决办法
6409
查看次数

如何更改从 Firebase Cloud Messaging Flutter 发送的通知图标

因此,我正在学习使用 Flutter 使用 Firebase Cloud Messaging 推送通知。

我已成功在 Android 中显示从 Firebase 控制台发送的通知,但问题是显示的图标与我的应用程序图标不匹配,如下所示: 在此输入图像描述

如何更改图标?谢谢

更新
所以实际上我认为这是我提供的资产形式的问题。因为如果通知位置进来并且你没有打开通知托盘,那么图标就是它应该的颜色。

但是当你打开通知托盘时,由于某种原因,图标变成灰色......

因为我看到好几个这样的申请,其中一个甚至是银行申请

push-notification firebase flutter firebase-cloud-messaging

1
推荐指数
1
解决办法
1830
查看次数