gpt4 book ai didi

android Facebook :preset_size doesn't exist in xml?

转载 作者:行者123 更新时间:2023-11-29 15:10:16 24 4
gpt4 key购买 nike

我正在尝试在我的应用中设置 profilepictureview:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="fr.djey.testf.MainFragment"
xmlns:facebook="http://schemas.android.com/apk/res-auto">

<com.facebook.login.widget.ProfilePictureView
android:id="@+id/facebook_avatar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/login_button"
android:layout_centerHorizontal="true"
/>

<com.facebook.login.widget.LoginButton
android:id="@+id/login_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginBottom="30dp"
android:layout_centerInParent="true"/>
</RelativeLayout>

而且我想给图片设置小尺寸。我在互联网上发现我必须输入 facebook:preset_size=small 但它似乎不再存在了。

你能告诉我是否有另一种方法可以在 xml 中(而不是在 java 中)执行此操作吗?

最佳答案

它已被替换为:

facebook:com_facebook_preset_size="小"

在父布局中添加:

xmlns:facebook="http://schemas.android.com/apk/res-auto"

在升级指南中有描述: https://developers.facebook.com/docs/android/upgrading-4.x --> 将 Android SDK 从 4.0.1 升级到 4.1.0

关于android Facebook :preset_size doesn't exist in xml?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32452617/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com