Breaking large text into pages in android text switcher or view flipper

前端 未结 1 1419
野趣味
野趣味 2021-02-06 09:55

I am in the process of developing an e-book reader application for android 3.0 tablets. To begin with I have a large chunk of String data. I want to split/break that String into

相关标签:
1条回答
  • 2021-02-06 10:16

    This is all you need to make your code work.

        DisplayMetrics dm = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(dm);
        int screenWidth = dm.widthPixels;
        int screenHeight= dm.heightPixels;
    

    Replace your following code block with mine. It will work.

    Display display = getWindowManager().getDefaultDisplay(); 
    int screenWidth = display.getWidth();
    int screenHeight = display.getHeight();
    
    0 讨论(0)
提交回复
热议问题