小编Bal*_*ala的帖子

Android ImageView在GingerBread下面的FrameLayout中没有match_parent

我正在尝试为聊天室建立一个讲话泡泡.每个语音气泡都有附加的xml布局. 

我通过设置实现这一目标的TextViewWRAP_CONTENT,对话泡泡的ImageViewmatch_parentframe_layoutWRAP_CONTENT.这样文本后面的speech_bubble图像  根据气泡中的文本量进行缩放

我在textView上设置宽度以匹配父级,将高度设置为wrap_content,由于某种原因,它在Ice Cream Sandwich(Android 4.1)中的要求下完美无缺.然而,在Gingerbread中,内部imageView语音气泡不会缩放到match_parent,因此文本可以整齐地适合气泡.在Gingerbread中,内部imageView 始终保持相同的大小,无论文本和文本溢出泡沫外.即使FrameLayout里扩展到WRAP_CONTENT,该ImageView的match_parent因为它应该. 

有关为什么会发生这种情况的任何想法?是否有我可以通过xml设置的另一个参数或我可以通过编程方式调用此方法进行修复的方法? 

谢谢!

ICS中的正确行为:

ICS中的正确行为

GingerBread中的行为不正确: GingerBread中的行为不正确

XML布局:

<merge xmlns:android="http://schemas.android.com/apk/res/android">
        <FrameLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/speech_bubble_framelayout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:background="@color/color_transparent"
            android:layout_toRightOf="@id/message_user_imageView">

        <ImageView xmlns:android="http://schemas.android.com/apk/res/android"
                   android:id="@+id/message_background_imageview"
                   android:layout_width="match_parent"
                   android:layout_height="match_parent"
                   android:layout_margin="5dp"
                   android:scaleType="fitXY"
                   android:layout_centerInParent="true"
                   android:textColor="@color/color_brown_mud"
                   android:background="@drawable/chat_bubble_flipped"
                />
        <TextView
                android:id="@+id/message_textView"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:maxEms="10"
                android:background="@color/color_transparent"
                android:textColor="@color/color_brown_uiDesign_pallete"
                android:textSize="15sp" …
Run Code Online (Sandbox Code Playgroud)

android android-layout android-imageview android-fragments android-listfragment

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

使用新的Android SDK 3.0邀请好友请求

我正在使用刚刚在Android上发布的新Facebook SDK 3.0.我想让用户邀请他/她的朋友加入应用程序.

但是,在新SDK中,您不会使用App ID 创建新的Facebook对象.您按照教程中的说明扩展了FacebookActivity:http://developers.facebook.com/docs/tutorials/androidsdk/3.0/scrumptious/authenticate/

因此,我无法使用提供的参考资料向朋友发送邀请,因为没有facebook对象可以调用对话方法. http://developers.facebook.com/docs/howtos/androidsdk/3.0/send-requests/

我已经设置了Friend Picker UI,可以获取用户选择的GraphUser对象.http:// developers(dot)facebook(dot)com/docs/tutorials/androidsdk/3.0/scrumptious/show-friends /

但是,我无法弄清楚如何邀请用户选择的朋友.

有谁知道如何在新SDK中邀请朋友?你会使用FbDialog类吗?如果是这样,需要提供的url字符串是什么?(我尝试使用" apprequests ",但这不起作用)

谢谢你的帮助.

android facebook facebook-android-sdk fbdialogs

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