Android应用程序中的图像获取奇怪的背景渐变

克里斯·伯格

我决定有一天要运行相同的应用程序,并发现图像获取的是这些怪异的黑色渐变状背景,而不是透明性。似乎图像未正确渲染。

图像是透明的。似乎图像的背景已被此错误替换。

有人知道怎么修这个东西吗?

在此处输入图片说明

在此处输入图片说明

这是xml布局文件:

<TableLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:padding="@dimen/padding_small"
    android:stretchColumns="2" >

    <TableRow
        android:id="@+id/tableRow1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="@dimen/padding_small" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center|fill_horizontal"
            android:padding="@dimen/padding_medium"
            android:text="@string/VincentiDesc2"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textStyle="italic" 
            android:layout_weight="1"
            android:ellipsize="none"
            android:maxLines="100"
            android:scrollHorizontally="false" />
    </TableRow>

    <TableRow
        android:id="@+id/tableRow2y"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

        <ImageView
            android:id="@+id/yes_button"
            android:layout_width="80dp"
            android:layout_height="50dp"
            android:layout_gravity="center"
            android:background="@drawable/abs__btn_cab_done_default_holo_light"
            android:scaleType="fitCenter"
            android:src="@drawable/yes_button" />
    </TableRow>

    <TableRow
        android:id="@+id/tableRow2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >

        <ImageView
            android:id="@+id/no_button"
            android:layout_width="80dp"
            android:layout_height="50dp"
            android:layout_gravity="center"
            android:background="@drawable/abs__btn_cab_done_default_holo_light"
            android:scaleType="fitCenter"
            android:src="@drawable/no_button" />
    </TableRow>

    <TableRow
        android:id="@+id/tableRow3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="@dimen/padding_small" >

        <TextView
            android:id="@+id/textView2"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center|fill_horizontal"
            android:padding="@dimen/padding_medium"
            android:text="@string/VincentiNoteDesc2"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textStyle="normal" 
            android:layout_weight="1"
            android:ellipsize="none"
            android:maxLines="100"
            android:scrollHorizontally="false" />
    </TableRow>
</TableLayout>

和片段

public class Description2Fragment extends SherlockFragment {
    OnNextPressedListener mListener;
    View nobutton;
    View yesbutton;

    //update Personal Info variables

private long PIid;
public PersonalInfo newPI;
private PersonalInfoDataSource datasource;

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

}

@Override
public void onStart() {
    super.onStart();

    nobutton = getActivity().findViewById(R.id.no_button);
    nobutton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            datasource = new PersonalInfoDataSource(getActivity());
            datasource.open();

            List<PersonalInfo> l = datasource.getAllPersonalInfos();
            if(l==null) {
                newPI = datasource.createPersonalInfo("", "", "", "", "", false,"","","","");
            } else if (l.size()==0) {
                newPI = datasource.createPersonalInfo("", "", "", "", "", false,"","","","");
            } else {
                newPI = l.get(0);
            }

            datasource.updatePersonalInfoStat(newPI.getId(), false);

            datasource.close();
            mListener.nextPressed(1);

        }
    });

    yesbutton = getActivity().findViewById(R.id.yes_button);
    yesbutton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {               
            //update Stat to 1 = TRUE
            datasource = new PersonalInfoDataSource(getActivity());
            datasource.open();

            List<PersonalInfo> l = datasource.getAllPersonalInfos();
            if(l==null) {
                newPI = datasource.createPersonalInfo("", "", "", "", "", false,"","","","");
            } else if (l.size()==0) {
                newPI = datasource.createPersonalInfo("", "", "", "", "", false,"","","","");
            } else {
                newPI = l.get(0);
            }

            datasource.updatePersonalInfoStat(newPI.getId(), true);

            datasource.close();
            mListener.nextPressed(1);

        }
    });
}
}

谢谢!

迈克·P。

编辑1:在实现ActionBarSherlock并运行布局(将图像显示为股票IC启动器图标),并放入背景色以提高可见度后,我得到以下信息:在此处输入图片说明

您可以清楚地看到android图标右侧的ABS透明线。

因此,在您的布局中看不到任何问题之前,我将自己检查图像。他们最近被保存了吗?您确定您的ActionBarSherlock图标集根本没有被删除吗?确保ABS图标存在于你的drawable-所有有关决议的资源文件夹。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Android 应用程序在动画渐变背景上崩溃

标题背景图像在 React 应用程序中以底部渐变滚动时消失并逐渐消失

Android应用程序中的listview中的奇怪故障

Flutter 应用程序中屏幕底部的背景图像

React Native应用程序中的全屏背景图像

在电子应用程序中未加载背景图像

Android应用程序中的奇怪地图行为

从相机获取图像时,Android应用程序仅在三星设备中崩溃

WhatsApp和Twitter在Android应用程序中未获取图像

如何从 Youtube 搜索应用程序中获取图像?

如何在WS应用程序中获取图像源

设置活动背景时,Android应用程序遇到奇怪的布局

如何在Android应用程序中更改背景颜色

在Android应用程序中设置背景图片

从Android应用程序将图像保存在Django中

Android应用程序中的ShapeDrawable Vs Png图像

应用程序从URL检索图像并在Android应用程序中显示崩溃

通知图标应用程序背景android

在 JSF 应用程序中更改和保存 css 渐变

使用 Swift 编程 iOS 应用程序时在 iPhone 中获取奇怪的磁力计数据

如何从图库中获取图像,裁剪图像并将其保存在应用程序中

(Android Studio)应用程序背景图像无法填满屏幕

在Android应用程序中获取当前时区

从Android中的GoogleApiClient获取我的应用程序的访问令牌

如何在LIBGDX Android应用程序中获取getContext()

在Android应用程序中从用户获取位置权限

在Cordova + Android中获取内部应用程序目录

从我的Android应用程序中的网页获取点击事件

在Android应用程序中获取城市的位置ID