inflate

    4熱度

    2回答

    我有一個自定義視圖,我想從資源模板創建。我的自定義視圖構造函數接受額外的參數,這些參數被設置爲自定義視圖的附加信息。 問題是當我膨脹視圖我得到的視圖對象不是從自定義視圖的子類,因爲膨脹方法是靜態的,並返回一個通用的新視圖,而不是我的自定義視圖的實例。 我在尋找的是一種通過將自定義視圖對象引用傳遞給視圖來誇大視圖的方法。 public class MLBalloonOverlayView ext

    1熱度

    1回答

    。然後,我將其寫入XML: main.xml中: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_wid

    0熱度

    2回答

    我遇到問題。 我用兩個ViewStubs在兩個區域中滑動我的屏幕。 但是,如果我膨脹了ViewStubs他們不能更容易訪問,我不能誇大此ViewStub內的其他視圖。 那麼什麼是使用這些類容器的替代方案。 這裏有一些代碼。你所有的愛代碼: ViewStub contentSpace = (ViewStub) findViewById(R.id.ContentSpace); conten

    1熱度

    1回答

    這可能是我遇到過的最煩人的錯誤。當我去膨脹的自定義視圖,並把它傳遞給和活動,我得到這個: 02-02 10:34:08.080: ERROR/AndroidRuntime(839): java.lang.RuntimeException: Unable to start activity ComponentInfo{android.appion.ResourceManager.UI/andro

    11熱度

    1回答

    我有充氣佈局的自定義適配器。 在適配器我嘗試在的TextView(@ ID/datetextcal) LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); cellView = inflater.inflate(R.layout.ca

    0熱度

    1回答

    如何在widget中使用imageswitcher? 我的代碼編譯罰款,但是當我嘗試創建我的小部件也給出了一個錯誤: Error inflating AppWidget AppWidgetProviderInfo(provider=ComponentInfo{test.basic/test.basic.HelloWorldWidget}): android.view.InflateExceptio

    0熱度

    2回答

    我已經花了幾個小時,這是一個佈局問題。有人能告訴我如何在同一活動中顯示圖像和視圖切換器。 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:myapp="http://schemas.android.com/apk/res/rg.client.muscle"

    0熱度

    1回答

    下面是我的代碼示例: 我膨脹了一個視圖,並且只想將動畫添加到膨脹的動畫中。現在它爲整個佈局做。 LinearLayout lLay = (LinearLayout)this.findViewById(R.id.FirstContact); AnimationSet set = new AnimationSet(true); Animation animation = new

    1熱度

    2回答

    我的程序處理PDF文件並從中讀取一些流。那裏還有FlateEncoded流。我使用zlib的「inflate()」方法來解壓縮它們。 這通常作品真的很好用下面的代碼: static string FlateDecode(string s){ int factor = 50; z_stream stream; while(true){ char * out

    0熱度

    1回答

    我對Android開發非常陌生,在這裏我遇到了一些小問題。 我想通過擴展TextView來創建一個自定義的TextView類,並在ListView中使用這個類(ListView的每一行都包含這個類的對象)。 我創建了我的自定義類這樣的 public class CustomTextView extends TextView{ Context context; Paint mPaint; S