小编Exi*_*e05的帖子

如何在Android中使微调器背景透明?

这是我的微调器布局,

<Spinner
    android:layout_marginLeft="20dp"
    android:background="@android:drawable/btn_dropdown"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/spinnerQuality"
    android:layout_gravity="center_horizontal"
    />
Run Code Online (Sandbox Code Playgroud)

和微调项目布局,

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:singleLine="true"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textColor="#000000"
    android:paddingTop="10dp"
    android:paddingLeft="10dp"/>
Run Code Online (Sandbox Code Playgroud)

并显示微调器是, 在此输入图像描述

但我想让微调器和下拉项目背景透明.我怎么会这样?

android android-layout android-spinner

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

Android从布局视图创建和打印pdf

我正在尝试从xml布局视图创建PDF文件.我在该布局中有一个列表视图,根据子项添加项目和设置高度.PDF正在创建但不填写整个页面.我试过的是,

 PdfDocument.PageInfo pageInfo = new PdfDocument.PageInfo.Builder(2250, 1400, 1).create();

        // start a page
        PdfDocument.Page page = document.startPage(pageInfo);


        // draw something on the page
        LayoutInflater inflater = (LayoutInflater)
                getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View content = inflater.inflate(R.layout.pdf_layout, null);

        content.measure(2250, 1400);
        content.layout(0,0, 2250, 1400);

        tvName = (TextView)content.findViewById(R.id.tvName);
        tvDate = (TextView)content.findViewById(R.id.tvDate);
        tvAge = (TextView)content.findViewById(R.id.tvAge);
        tvGender = (TextView)content.findViewById(R.id.tvGender);
        tvPhone = (TextView)content.findViewById(R.id.tvPhone);
        lvList = (ListView)content.findViewById(R.id.lvList);
        lvList.setAdapter(adapter);
        Utils.setListViewHeight(lvList, CreatePDFDemo.this);

        tvName.setText(name);
        tvAge.setText(age + "Y");
        tvGender.setText(gender);
        tvPhone.setText(phone);

        content.draw(page.getCanvas());

        // finish the page
        document.finishPage(page);
        // add more pages
        // write the document content
        try …
Run Code Online (Sandbox Code Playgroud)

pdf android pdf-generation android-layout androidpdfviewer

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

从资源字符串数组创建ArrayList <String>

我已经声明了ArrayList,

var otherSeriesList = ArrayList<String>()
Run Code Online (Sandbox Code Playgroud)

并尝试通过以下方式从资源获取数据,

otherSeriesList = ArrayList<String>(Arrays.asList(resources.getStringArray(R.array.get_other_series)))
Run Code Online (Sandbox Code Playgroud)

但我收到了错误.请看图像 - 在此输入图像描述

我应该如何从资源字符串数组创建ArrayList?

android kotlin

6
推荐指数
2
解决办法
2170
查看次数

将手机号码传递给Facebook AccountKitActivity

我使用Facebook帐户工具包来验证用户手机号码.我使用下面的代码,

final Intent intent = new Intent(MainActivity.this, AccountKitActivity.class);
    AccountKitConfiguration.AccountKitConfigurationBuilder configurationBuilder =
            new AccountKitConfiguration.AccountKitConfigurationBuilder(
                    LoginType.PHONE,
                    AccountKitActivity.ResponseType.TOKEN); // or .ResponseType.TOKEN
    // ... perform additional configuration ...
    intent.putExtra(
            AccountKitActivity.ACCOUNT_KIT_ACTIVITY_CONFIGURATION,
            configurationBuilder.build());
    startActivityForResult(intent, APP_REQUEST_CODE);
Run Code Online (Sandbox Code Playgroud)

一切都很顺利.我想将用户手机号码传递给AccountKit活动.它可以使它工作吗?怎么样?实际上我想使用Account Kit防止重复的移动验证,还有其他方法吗?

android facebook account-kit

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